-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yaml
32 lines (30 loc) · 1.14 KB
/
buildspec.yaml
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
Version: 0.2
env:
secrets-manager:
DOCKERHUB_USERNAME: "arn:aws:secretsmanager:us-east-2:368772107083:secret:docker/Account/credentials-1NLbNK:username"
DOCKERHUB_PASSWORD: "arn:aws:secretsmanager:us-east-2:368772107083:secret:docker/Account/credentials-1NLbNK:password"
phases:
pre_build:
commands:
- echo Logging in to Docker Hub...
- echo $DOCKERHUB_PASSWORD | docker login --username $DOCKERHUB_USERNAME --password-stdin
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin $ECR_URI
build:
commands:
- echo build started on 'date'
- echo building the Docker image..
- docker build -t $ECR_URI:nestjs .
- docker tag $ECR_URI:nestjs $ECR_URI:$IMAGE_TAG
post_build:
commands:
- echo build complete 'date'
- echo pushing the docker image
- docker push $ECR_URI:$IMAGE_TAG
- echo Writing imageDetail file...
- printf '{"ImageURI":"%s"}' $ECR_URI:$IMAGE_TAG > imageDetail.json
artifacts:
files:
- imageDetail.json
- appspec.yaml
- taskdef.json