Browse Source

Travis: do not deploy for pull requests

tempestpy_adaptions
Matthias Volk 6 years ago
parent
commit
c9c2ed09ad
  1. 16
      .travis.yml
  2. 39
      travis/deploy_carl.sh
  3. 39
      travis/deploy_storm.sh
  4. 20
      travis/generate_travis.py

16
.travis.yml

@ -52,9 +52,7 @@ jobs:
script:
- travis/build_carl.sh
after_success:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker commit carl movesrwth/carl:travis-debug;
- docker push movesrwth/carl:travis-debug;
- travis/deploy_carl.sh
# ubuntu-18.04 - DefaultReleaseTravis
- stage: Build Carl
os: linux
@ -67,9 +65,7 @@ jobs:
script:
- travis/build_carl.sh
after_success:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker commit carl movesrwth/carl:travis;
- docker push movesrwth/carl:travis;
- travis/deploy_carl.sh
###
# Stage: Build (1st run)
@ -507,9 +503,7 @@ jobs:
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
after_success:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker commit storm movesrwth/storm:travis-debug;
- docker push movesrwth/storm:travis-debug;
- travis/deploy_storm.sh
# ubuntu-18.04 - DefaultReleaseTravis
- stage: Test all
os: linux
@ -526,9 +520,7 @@ jobs:
after_failure:
- find build -iname '*err*.log' -type f -print -exec cat {} \;
after_success:
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";
- docker commit storm movesrwth/storm:travis;
- docker push movesrwth/storm:travis;
- travis/deploy_storm.sh
# ubuntu-18.04 - DefaultDebug
- stage: Test all
os: linux

39
travis/deploy_carl.sh

@ -0,0 +1,39 @@
#!/bin/bash -x
set -e
OS=$TRAVIS_OS_NAME
case $OS in
linux)
# Only deploy for non pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release
case "$CONFIG" in
*DebugTravis)
docker commit carl movesrwth/carl:travis-debug
docker push movesrwth/carl:travis-debug
;;
*ReleaseTravis)
docker commit carl movesrwth/carl:travis
docker push movesrwth/carl:travis
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
fi
;;
osx)
echo "Building carl on Mac OSX not used."
exit 1
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac

39
travis/deploy_storm.sh

@ -0,0 +1,39 @@
#!/bin/bash -x
set -e
OS=$TRAVIS_OS_NAME
case $OS in
linux)
# Only deploy for non pull requests
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release
case "$CONFIG" in
*DebugTravis)
docker commit storm movesrwth/storm:travis-debug
docker push movesrwth/storm:travis-debug
;;
*ReleaseTravis)
docker commit storm movesrwth/storm:travis
docker push movesrwth/storm:travis
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
fi
;;
osx)
echo "Building Storm on Mac OSX not used."
exit 1
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac

20
travis/generate_travis.py

@ -97,15 +97,7 @@ if __name__ == "__main__":
buildConfig += " - travis/build_carl.sh\n"
# Upload to DockerHub
buildConfig += " after_success:\n"
buildConfig += ' - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";\n'
if "Debug" in build_type:
buildConfig += " - docker commit carl movesrwth/carl:travis-debug;\n"
buildConfig += " - docker push movesrwth/carl:travis-debug;\n"
elif "Release" in build_type:
buildConfig += " - docker commit carl movesrwth/carl:travis;\n"
buildConfig += " - docker push movesrwth/carl:travis;\n"
else:
assert False
buildConfig += " - travis/deploy_carl.sh\n"
s += buildConfig
# Generate all configurations
@ -169,15 +161,7 @@ if __name__ == "__main__":
# Upload to DockerHub
if stage[1] == "TestAll" and "Travis" in build_type:
buildConfig += " after_success:\n"
buildConfig += ' - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD";\n'
if "Debug" in build_type:
buildConfig += " - docker commit storm movesrwth/storm:travis-debug;\n"
buildConfig += " - docker push movesrwth/storm:travis-debug;\n"
elif "Release" in build_type:
buildConfig += " - docker commit storm movesrwth/storm:travis;\n"
buildConfig += " - docker push movesrwth/storm:travis;\n"
else:
assert False
buildConfig += " - travis/deploy_storm.sh\n"
s += buildConfig
if "Travis" in build_type and "Release" in build_type:
allow_failures.append(allow_fail)

Loading…
Cancel
Save