forked from prometheus-msteams/prometheus-msteams
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtravis.sh
32 lines (24 loc) · 731 Bytes
/
travis.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
#!/bin/bash
if [[ -n ${TRAVIS_PULL_REQUEST_BRANCH} ]]; then
export VERSION=${TRAVIS_PULL_REQUEST_BRANCH}
else
export VERSION=${TRAVIS_TAG:-${TRAVIS_BRANCH}}
fi
echo "Building app version $VERSION"
make all VERSION=${VERSION}
make docker VERSION=${VERSION}
if [[ -n ${TRAVIS_PULL_REQUEST_BRANCH} ]]; then
echo "Skip building docker images"
exit 0
fi
if [[ -n ${TRAVIS_TAG} || ${TRAVIS_BRANCH} == "master" ]]; then
make docker-tag-latest VERSION=${VERSION}
# login to dockerhub
make docker-hub-login
make docker-hub-push VERSION=latest
make docker-hub-push VERSION=${VERSION}
# login to quay.io
make docker-quay-login
make docker-quay-push VERSION=latest
make docker-quay-push VERSION=${VERSION}
fi