forked from mchang6137/quilt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-push.sh
executable file
·41 lines (28 loc) · 940 Bytes
/
build-push.sh
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
40
41
#!/bin/bash
function status_line() {
echo -e "\n### ${1} ###\n"
}
# Exit upon any error
set -e
status_line "Begin build..."
make all check lint
if [[ $(make -s lint 2>&1) ]] ; then # golint doesn't fail, just prints things.
exit 1
fi
status_line "Building containers..."
make docker-build-di docker-build-tester docker-build-minion
status_line "Successfully built containers."
if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
status_line "This is a pull request, not pushing containers."
exit 0
fi
if [ "$TRAVIS_BRANCH" != "master" ]; then
status_line "This is not the master branch, not pushing containers."
exit 0
fi
docker version
status_line "Pushing containers..."
docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" quay.io
status_line "Successfully logged into docker."
make docker-push-di docker-push-tester docker-push-minion
status_line "Successfully pushed containers."