-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathbuildspec.yml.old
More file actions
29 lines (27 loc) · 953 Bytes
/
buildspec.yml.old
File metadata and controls
29 lines (27 loc) · 953 Bytes
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
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
pre_build:
commands:
- $(aws ecr get-login --region us-east-1 --no-include-email)
- datetime="$(date +'%Y%m%d%H%M')"
- version="$(cat .version)"
- git_hash=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
- image=454531037350.dkr.ecr.us-east-1.amazonaws.com/$ECR_REPO
build:
commands:
- docker build -t ${image}:latest .
post_build:
commands:
- docker tag ${image}:latest ${image}:${datetime}
- docker tag ${image}:latest ${image}:${git_hash}
- docker tag ${image}:latest ${image}:${version}
- docker push ${image}:latest
- docker push ${image}:${datetime}
- docker push ${image}:${git_hash}
- docker push ${image}:${version}
- printf '[{"name":"rudder-transformer","imageUri":"%s"}]' ${image}:${version} > imagedefinitions.json
artifacts:
files: imagedefinitions.json