Deploying Admin Settings From Staging to Production

(Everaldo Gomes) #1

Hi guys.

It’s my first topic. Sorry if I’m posting on the wrong place.
Also, I’ve made some research, but I couldn’t find a topic that fully answer my doubts. Here we go…

I work from a company that chose Discourse as a community platform.

They want to have two different environments: staging and production.

On staging, we devs make changes on CSS, Categories, Permissions etc.

On production, the client make posts, new users register etc.

Also, we are using Single Sign On.

We need to set a workflow to deploy settings from staging to production, without breaking the application or accidentally removing topics, users or category (losing content).

Can anyone, please, help me find information on how to export admin settings without breaking the other server (for instance, hostname will be different, SSO credentials too. This sort of thing).

I appreciate your help.

Everaldo Gomes

(Sam Saffron) #2

What you are describing here is a very very custom setup. It is doable but would require significant dev time to build the custom import/export logic.

Nothing out of the box will fill this desired workflow.

(Neil Lalonde) #3

For CSS/HTML changes, there are Export and Import buttons so you can move those changes easily. Disable the current one, and create a new one from the import.

It might make sense to have something similar for site settings.

(Mittineague) #4

There is the site_settings table that would be in a backup.
But cherry-picking that out of all the rest of it does seem like it would be a less efficient way to go about it.

(Neil Lalonde) #5

There have been a few occasions where I’m working on an import somewhere and someone else is customizing ALL the site settings somewhere else to prepare for a site launch. At some point we need to merge our work, which turns into manually re-entering the site settings again.

(Everaldo Gomes) #6

Many thanks, guys!

I was wondering, if discourse_api has endpoints to update site_settings.

Because, it seems easier to use an API rather to sshing into a server, then enter on the docker container or restoring/backuping a database.

I appreciate your help.

I told my fellows that it’s easier to do manually, but they want to make sure there isn’t a way to automate this task.

Besides, in my opinion, this kind of setup is usually “one time only”.


(cpradio) #7

There is definitely APIs, as the entire web app uses an API, you would have to pass in an Admin username and key though. And you’d have to use the Network tab of Dev Tools to see what call to make.