-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yaml
37 lines (35 loc) · 1.12 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
33
34
35
36
37
version: 0.2
env:
variables:
REPO: "667650582711.dkr.ecr.us-west-2.amazonaws.com/mkt-jobs"
SLACK_CHANNEL: "website"
parameter-store:
SLACK_TOKEN: "slack_token"
phases:
pre_build:
commands:
- sh slack_notify.sh "starting pre_build project ${REPO}"
- $(aws ecr get-login --no-include-email --region "${AWS_DEFAULT_REGION}")
- echo "$(date +%Y%m%d%H%M%S)" > .codebuild_version
finally:
- sh slack_notify.sh "pre_build complete for project ${REPO}"
build:
commands:
- docker build -t "${REPO}:latest" .
# tag the new docker file with the build_id
- docker tag "${REPO}:latest" "${REPO}:$(cat .codebuild_version)"
# push the image with latest to the repo:
- docker push "${REPO}:latest"
# push the image with the build id tag to the repo:
- docker push "${REPO}:$(cat .codebuild_version)"
finally:
- sh slack_notify.sh "build complete for project ${REPO}"
post_build:
commands:
- echo "post_build"
finally:
- sh slack_notify.sh "post_build complete for project ${REPO}"
artifacts:
discard-paths: no
files:
- "**/*"