Report this

What is the reason for this report?

How to use pipelines for development/production environments like Heroku using App Platform ?

Posted on October 2, 2023

I wanted to use pipelines to manage environments for production and staging so the app can be tested with all the changes made before push them to production, just like heroku does. I was wondering how can I achieve this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there,

What you could do to achieve this is to create a separate app to act as your staging environment which will be separate from your production app.

Basically, create two separate apps on the App Platform, one for staging and one for production. That way you will ensure that any changes made in the staging environment do not affect the production environment until you’re ready.

Then you can set up a deployment from GitHub and for the staging app, you might want to deploy from a development or staging branch, while the production app deploys from the main branch.

Next, you can enable automatic deployments for the staging app, so every time you push changes to your development or staging branch, the staging app gets updated.

For the production app, you can choose to manually deploy when you’re confident about the changes. Alternatively, you can also set it to auto-deploy from the main branch if you prefer.

Once you’ve tested your changes in the staging environment and are satisfied, merge your changes from the development or staging branch into the main branch.

This process will mimic the pipeline structure you mentioned with Heroku. The key is maintaining separate environments for staging and production, ensuring you test all changes in a safe environment before deploying them to production.

I would also suggest having separate databases for the two environments so that the staging deployments would not affect your production environment.

Hope that this helps!

Best,

Bobby

I haven’t figured it out quite yet myself, but I did notice DigitalOcean appears to assign the Development/Production designations on “Project” Creation (no where else I’ve seen yet)… so I have made the assumption that’s where the split is supposed to be, each project is an environment.

The next question I think becomes, how do we promote code and infrastructure between environments. I think there are two traditional approaches, promoting from one environment to the next in series (usually artifacts move from dev, test then prod) or promoting in parallel (usually source to each) as the artifacts pass the environment tests. My suspicion is that replicating the steps performed in develop project via the production project is the way to go, so there needs to be some kind of flow/envi control in the app to automate anything (prod/dev variables).

However, I honestly haven’t gotten that far. I’m still trying to setup automated deployments, secretes management, and DB schema migrations on the dev environment. There doesn’t seem to be a way to kick off schema migrations to DO’s DBs, might need a db_migrator to do it but wasn’t able to figure that out yet.

A year later, let the world know if anyone found anything new =)

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Dark mode is coming soon.