-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
39 lines (38 loc) · 1.52 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
32
33
34
35
36
37
38
39
version: 0.2
phases:
install:
runtime-versions:
docker: 18
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- REPOSITORY_URI=134071937287.dkr.ecr.us-west-2.amazonaws.com/refinery-api-server-prod
- REPOSITORY_NGINX_URI=134071937287.dkr.ecr.us-west-2.amazonaws.com/refinery-nginx-server
- COMMIT_HASH=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- IMAGE_TAG=${COMMIT_HASH:=latest}
- docker login --username freeqaz --password 62e6d27d-9cc3-4c3a-b7d2-af0f824ea370
build:
commands:
- echo Build started on `date`
- echo Building the Refinery API server Docker image...
- docker build -t $REPOSITORY_URI:latest ./api/
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
- cd front-end
- ./build/build-production-assets.sh
- mv front-end-dist ../nginx-container/front-end-dist
- cd ..
- docker build -t $REPOSITORY_NGINX_URI:latest ./nginx-container/
- docker tag $REPOSITORY_NGINX_URI:latest $REPOSITORY_NGINX_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker API server images...
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
- docker push $REPOSITORY_NGINX_URI:latest
- docker push $REPOSITORY_NGINX_URI:$IMAGE_TAG
artifacts:
base-directory: elasticbeanstalk-config/
files: "**/*"