Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

> making the blue/green deploys work smoothly. Is that something you have dealt with? #968

Open
jefftriplett opened this issue Mar 31, 2023 · 1 comment

Comments

@jefftriplett
Copy link
Contributor

jefftriplett commented Mar 31, 2023

Bringing this into it's own issue to follow up on.

          > making the blue/green deploys work smoothly. Is that something you have dealt with?

Yes, in parts (because I haven't implemented an automated rollback routine).

I was greatly inspired by the things done in djangopackages, although the end result of the configurations is quite different.

The changes I made regarding djangopackages' blue/green implementation were that:

  • I don't use docker compose to compile the docker images on Digital Ocean. I have a custom script that does this for me locally and on Github Actions and that uses docker build with some extra arguments (like including the git commit hash value an environment var APPLICATION_VERSION the docker image)
  • The docker image (along with backend and frontend compiled source code) is built in a Github Action and uploaded to Github Packages
  • I have implemented a docker health check for all docker services
  • Docker compose only references the image in github packages, and I basically run docker compose pull django-a + docker compose up -d --wait
  • for docker on DO to have access to Github packages, we need to create another github account (to work as machine account) and create a CLASSIC personal github token with the "read:packages" permission : login with the new github account and create the token using https://github.com/settings/tokens/new?scopes=read:packages
    GH_TOKEN="<TOKEN_HASH>"
    GH_USER="<GITHUB_USERNAME>"
    echo "${GH_TOKEN}" | docker login ghcr.io -u "${GH_USER}" --password-stdin

If django-a's health check never reports the healthy state to docker, then django-b will never get updated because the script will timeout and the deploy process will return a fail status

Originally posted by @luzfcb in #876 (comment)

@bhbdb
Copy link

bhbdb commented Apr 2, 2023

Blue Ocean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants