Skip to content

Set up Deploy #38

@jayvarner

Description

@jayvarner

Take a look at this build script as an example. There are a few differences/needed improvements to make.

Changes:

  1. We don't need the build-arg flags
  2. The -t arg should be otb
  3. References to becket-data-api on lines 19 and 22 should be replaced with otb

Improvements:

We should set the image tag, AWS_ECS_CLUSTER/SERVICE vars based on the branch. At the top we should add something that looks like:

TAG=$([ "$BRANCH" == "main" ] && echo "stable" || echo "latest")

For the AWS_ECS_CLUSTER var, we will have GitHub secrets for both dev and pord that will be base and environment vars to the build script. So like the tag, we will need to add something like:

AWS_ECS_CLUSTER=$([ "$BRANCH" == "main" ] && echo $AWS_ECS_CLUSTER_PROD || echo $AWS_ECS_CLUSTER_DEV)

You can add another one for AWS_ECS_SERVICE.

The lines that tag and push the image should be updated to use the dynamically set set tag, e.g.

docker tag otb "${AWS_ECR}/otb:${TAG}"

Deploy Workflow

Again, using the beckett-data-api workflows as an example, you can rework the this bit for our purposes here.

  1. Chage the settings for the cluster and service vars, as in:
AWS_ECS_CLUSTER_DEV: ${{ secrets.AWS_ECS_CLUSTER_DEV }}
  1. We don't need the RAILS_MASTER_KEY or REDIS_URL here.
  2. You need to add the develop branch to the list of branches.

Create and ENTRYPOINT Script for the Docker Build

Again with the beckett-data-api example, the Dockerfile uses an entrypoint script instead of a CMD. We don't need the sidekiq bit for OTB, but it's helpful to be able to run the migrations on each deploy.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions