-
Notifications
You must be signed in to change notification settings - Fork 54
/
buildspec.yml
31 lines (29 loc) · 1.04 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
env:
secrets-manager:
USERNAME: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:username"
PASSWORD: "com.amazonaws.ec2.madison.dockerhub.amazon-ecs-local-container-endpoints.credentials:password"
phases:
install:
commands:
- echo '#!/bin/bash' > /usr/local/bin/ok; echo 'if [[ "$CODEBUILD_BUILD_SUCCEEDING" == "0" ]]; then exit 1; else exit 0; fi' >> /usr/local/bin/ok; chmod +x /usr/local/bin/ok
pre_build:
commands:
- echo "Logging into DockerHub..."
- docker login -u ${USERNAME} --password ${PASSWORD}
build:
# build and tag docker image. This will read ARCH_SUFFIX env var set in the
# Codebuild project.
commands:
- echo Build started on `date`
- echo Building Docker image...
- make build-image
- make publish-dockerhub
- |
if [ $ARCH_SUFFIX = "amd64" ]; then
make tag-latest
make publish-dockerhub-latest
fi
post_build:
commands:
- ok && echo Build completed on `date`