forked from mkobit/docker-nifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis_build.sh
executable file
·25 lines (23 loc) · 941 Bytes
/
travis_build.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
#!/usr/bin/env bash
set -euo pipefail
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "Build Pull Request #${TRAVIS_PULL_REQUEST} => Branch [${TRAVIS_BRANCH}]"
./make_docker.py build \
--template-file "${TEMPLATE_FILE}" \
--template-substitutions "${TEMPLATE_VALUES}" \
--destination-file "${DESTINATION}" \
--repository "${DOCKER_REPOSITORY}" \
--tags "${DOCKER_TAGS}"
elif [ "${TRAVIS_PULL_REQUEST}" == "false" -a "${TRAVIS_BRANCH}" == "master" ]; then
echo "Build and Push Branch [${TRAVIS_BRANCH}] to Docker Hub with tags => [${DOCKER_TAGS}]"
./make_docker.py push \
--template-file "${TEMPLATE_FILE}" \
--template-substitutions "${TEMPLATE_VALUES}" \
--destination-file "${DESTINATION}" \
--repository "${DOCKER_REPOSITORY}" \
--tags "${DOCKER_TAGS}" \
--username "${DOCKER_USERNAME}" \
--password "${DOCKER_PASSWORD}"
else
echo "No action for [${TRAVIS_REPO_SLUG}]"
fi