The app lives on AWS in three environments, alerts-concierge-prod
,
alerts-concierge-dev
, and alerts-concierge-dev-green
. The app runs as an
Elixir release in a Docker container. The Docker images are hosted on AWS ECR,
and the containers are run on Fargate.
Deploying to the environments is done via GitHub Actions:
-
Commits on the main branch are auto-deployed to
dev
if they pass CI. -
Manual deploys to all environments are done via the deploy workflow: Click "Run workflow", select a branch, and enter the environment to deploy to. Only the main branch can be deployed to
prod
anddev
; usedev-green
to test unmerged branches.
Note currently you can only select a branch in the deploy workflow, not a tag or an arbitrary commit — this is a limitation of GitHub Actions. If you need to roll back a deploy, you will have to temporarily create and push a branch that is at the commit you want to roll back to, i.e.:
git checkout <SHA>
git checkout -b temp-deploy
git push -u
- Select
temp-deploy
in the workflow
You can find the required SHA using the deploy log for the environment you are rolling back.
Here's how to change them on AWS:
-
Go to the ECS dashboard
-
Click "Task Definitions" in the sidebar
-
Check the box next to the environment that you want to make the change to
-
This should enable the "Create new revision" button along the top. Click it. This clones the most recent settings so you can make the changes you want.
-
In the "Container Definitions" section 2/3 of the way down, click the link in the table under Container Name (e.g. alerts-concierge-dev-green). A panel should slide in from the side.
-
In this panel, there's an "Env Variables" section. You can create, delete, or update environment variables there.
-
Click the "Update" button on the bottom. The panel slides away.
-
Click the "Create" button on the bottom. There should be a green "Created new revision of Task Defintion foo:# successfully" at the top.
At this point, the newest task definition has the desired environment variables. However, the alerts-concierge app will still be running the old task definition. To make the app restart, picking up the new changes, it needs to be re-deployed from Semaphore.