Skip to content

Commit

Permalink
Add codebuild config
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Hobson committed Sep 2, 2021
1 parent 4cda7cc commit 29aac83
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 0.2

phases:
build:
on-failure: ABORT
commands:
- ./scripts/codebuild
22 changes: 22 additions & 0 deletions scripts/codebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euo pipefail
set -x

echo "${DOCKER_PASSWORD}" | \
docker login --username "${DOCKER_USERNAME}" --password-stdin

docker build -t "${ECR_REPO}:exp" .

aws ecr get-login-password --region $AWS_REGION \
| docker login --username AWS --password-stdin "${ECR_REPO}"

docker push "${ECR_REPO}:exp"

aws ecs update-service \
--cluster loadtesting \
--service exp-web \
--task-definition exp-web-loadtesting:3 \
--desired-count 1

exit 0

0 comments on commit 29aac83

Please sign in to comment.