Browse Source

Travis: Disable deployment if no credentials are given

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
7e61ab4a0f
  1. 14
      travis/deploy_carl.sh
  2. 14
      travis/deploy_storm.sh

14
travis/deploy_carl.sh

@ -4,10 +4,19 @@ set -e
OS=$TRAVIS_OS_NAME OS=$TRAVIS_OS_NAME
# Do not deploy if credentials are not given
if [ "${TRAVIS_SECURE_ENV_VARS}" == "false" ]; then
echo "WARNING: Not deploying as no credentials are given."
exit 0;
fi
# Do not deploy for pull requests
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
exit 0;
fi
case $OS in case $OS in
linux) linux)
# Only deploy for non pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release # Deploy as debug/release
case "$CONFIG" in case "$CONFIG" in
@ -23,7 +32,6 @@ linux)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;; ;;
esac esac
fi
;; ;;
osx) osx)

14
travis/deploy_storm.sh

@ -4,10 +4,19 @@ set -e
OS=$TRAVIS_OS_NAME OS=$TRAVIS_OS_NAME
# Do not deploy if credentials are not given
if [ "${TRAVIS_SECURE_ENV_VARS}" == "false" ]; then
echo "WARNING: Not deploying as no credentials are given."
exit 0;
fi
# Do not deploy for pull requests
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
exit 0;
fi
case $OS in case $OS in
linux) linux)
# Only deploy for non pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release # Deploy as debug/release
case "$CONFIG" in case "$CONFIG" in
@ -23,7 +32,6 @@ linux)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1 echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;; ;;
esac esac
fi
;; ;;
osx) osx)

Loading…
Cancel
Save