isomerpages / isomercms-backend

A static website builder and host for the Singapore Government
5 stars 1 forks source link

fix(ecs): misc fixes for deployment workflow for staging #1114

Closed seaerchin closed 8 months ago

seaerchin commented 8 months ago

Problem

There were issues previously which would lead to a failed deployment of our code to ecs. These are fixed here and will be explained below

Solution

  1. add appspec.json - we require this for aws codedeploy, which is used under the hood to do a blue green deployment of our app
  2. update task definitions for staging + prod
    • env vars can only be string so non-string values were coerced to string
    • add missing env vars (i think max limit was hit previously? unsure because i added this using a script)
    • update log groups for staging (was piping to prod :monkas:)
    • update task + exec roles
  3. update deployment workflow for staging (NOTE: this file does not exist for prod) to use codedeploy (ecs component in our ogp lib uses it under the hood)
  4. add command to list safe directories in dockerfile, required so that git won't complain
  5. add double quotes for ssh key fetching; will fail otherwise as hte newline will be stripped.