Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 2.55 KB

aws.md

File metadata and controls

66 lines (44 loc) · 2.55 KB

Deploying

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 and dev; use dev-green to test unmerged branches.

Rolling back a deploy

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.:

  1. git checkout <SHA>
  2. git checkout -b temp-deploy
  3. git push -u
  4. Select temp-deploy in the workflow

You can find the required SHA using the deploy log for the environment you are rolling back.

Environment variables

Here's how to change them on AWS:

  1. Go to the ECS dashboard

  2. Click "Task Definitions" in the sidebar

  3. Check the box next to the environment that you want to make the change to

  4. 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.

  5. 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.

  6. In this panel, there's an "Env Variables" section. You can create, delete, or update environment variables there.

  7. Click the "Update" button on the bottom. The panel slides away.

  8. 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.