diff --git a/buildspec.yml b/buildspec.yml new file mode 100644 index 00000000..7e067bee --- /dev/null +++ b/buildspec.yml @@ -0,0 +1,7 @@ +version: 0.2 + +phases: + build: + on-failure: ABORT + commands: + - ./scripts/codebuild diff --git a/scripts/codebuild b/scripts/codebuild new file mode 100755 index 00000000..a0e58972 --- /dev/null +++ b/scripts/codebuild @@ -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