Skip to content

Add ECR deploy#241

Merged
hbradio merged 7 commits intoalphafrom
add-ecr-deploy
Jul 8, 2019
Merged

Add ECR deploy#241
hbradio merged 7 commits intoalphafrom
add-ecr-deploy

Conversation

@hbradio
Copy link
Copy Markdown
Collaborator

@hbradio hbradio commented Jul 6, 2019

This PR makes travis build and deploy the Docker image to our private Elastic Container Repository.

It relies on finding AWS role credentials in Travis' secret environment (newer feature of Travis, which is pretty cool). I've added them there.

We tag the image as either alpha, beta, or prod.

Here is an example of a successful deploy on my working branch.

@hbradio hbradio added this to the Beta milestone Jul 6, 2019
@hbradio hbradio self-assigned this Jul 6, 2019

cp ./compose/django/Dockerfile .
docker build -t 795223264977.dkr.ecr.us-east-2.amazonaws.com/rovercode-web-service:$1 .
eval $(aws ecr get-login --region us-east-2 --no-include-email) # requires AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY secret environment variable set in Travis
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this looks bad, but it's really cool. get-login is an AWS CLI utility that takes your AWS role credentials and returns the text of a valid Docker login command to your account. If you eval what it returns, you log Docker into your ECR.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 6, 2019

Coverage Status

Coverage remained the same at 100.0% when pulling 5bce169 on add-ecr-deploy into 02a0e12 on alpha.

ecr-deploy.sh Outdated

pip install awscli

cp ./compose/django/Dockerfile .
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use the -f argument for docker build to provide the path to this file and not have to copy it

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice! Done.

@hbradio hbradio merged commit aa698d6 into alpha Jul 8, 2019
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

Successfully merging this pull request may close these issues.

3 participants