Seneca-CDOT / telescope

A tool for tracking blogs in orbit around Seneca's open source involvement
https://telescope.cdot.systems
BSD 2-Clause "Simplified" License
93 stars 188 forks source link

Research whether we can programmatically deploy via Portainer #3410

Open humphd opened 2 years ago

humphd commented 2 years ago

We're starting to use Portainer for more things on staging and production. However, I don't think we're doing as much as we could. One thing I'd like to explore is having our autodeployment server do API calls to Portainer in order to update existing or deploy new stacks. Essentially, I'd like to see if we can move our deploy logic out of the autodeployment server and into Portainer.

To do this, I'm wondering if we should move Portainer out of our Docker Compose (i.e., don't have Portainer control Portainer). Then it could survive redeploys.

There is a Portainer API we could use. The autodeployment server could do this, or possibly we could move everything into the GitHub Actions calls (e.g., the workflows do the API calls directly).

I'm not sure if this is what we should do or not, it needs some thought and research. One of my goals for exploring this is to improve the stability of our deployments, and make it easier to roll-back or deploy an arbitrary version via API or web console.

humphd commented 1 year ago

Somewhat related to this: with Starchart, I want to try using Docker Swarm mode, which is often paired with Portainer and these webhooks to redeploy/update a stack. Once we get that working, we could try experimenting with this in Telescope.