-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
31 lines (25 loc) · 1.33 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
version: 0.2
phases:
pre_build:
commands:
- $(aws ecr get-login --region $AWS_REGION)
- VERSION=$(date +%s)
- aws s3 cp s3://$BUILD_BUCKET/gcloud-service-account.json wordpress/
build:
commands:
- docker build -t react:$VERSION ./react --build-arg G_RECAPTCHA_SITEKEY=$G_RECAPTCHA_SITEKEY --build-arg AUTOMATED_JWT_TOKEN=$AUTOMATED_JWT_TOKEN --build-arg SENTRY_DSN_REACT=$SENTRY_DSN_REACT
- docker build -t varnish:$VERSION --build-arg PURGERS_ACL=$PURGERS_ACL ./varnish
- docker build -t wordpress:$VERSION ./wordpress
- docker tag react:$VERSION $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/react:$VERSION
- docker tag varnish:$VERSION $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/varnish:$VERSION
- docker tag wordpress:$VERSION $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/wordpress:$VERSION
post_build:
commands:
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/react:$VERSION
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/wordpress:$VERSION
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com/varnish:$VERSION
- sed "s/AWS_ACCOUNT_ID/$AWS_ACCOUNT_ID/g;s/VERSION/$VERSION/g" Dockerrun.aws.template.json > Dockerrun.aws.json
artifacts:
files:
- .ebextensions/*
- Dockerrun.aws.json