Browse Source

Travis: deploy to Docker Hub

refactoring
Matthias Volk 5 years ago
parent
commit
59ab38c1ea
  1. 8
      .travis.yml
  2. 48
      travis/deploy_docker.sh

8
.travis.yml

@ -31,12 +31,20 @@ jobs:
env: TASK=Test CONFIG=Release DOCKER=storm:travis PYTHON=python3 env: TASK=Test CONFIG=Release DOCKER=storm:travis PYTHON=python3
script: script:
travis/build.sh travis/build.sh
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh stormpy
# Docker Storm master in debug mode # Docker Storm master in debug mode
- os: linux - os: linux
compiler: gcc compiler: gcc
env: TASK=Test CONFIG=Debug DOCKER=storm:travis-debug PYTHON=python3 env: TASK=Test CONFIG=Debug DOCKER=storm:travis-debug PYTHON=python3
script: script:
travis/build.sh travis/build.sh
deploy:
- provider: script
skip_cleanup: true
script: bash travis/deploy_docker.sh stormpy
# Docker Storm stable # Docker Storm stable
- os: linux - os: linux
compiler: gcc compiler: gcc

48
travis/deploy_docker.sh

@ -0,0 +1,48 @@
#!/bin/bash -x
set -e
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
echo "Deploying $1 to Dockerhub"
case $OS in
linux)
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Deploy as debug/release
case "$CONFIG" in
*Debug*)
docker commit $1 movesrwth/$1:travis-debug
docker push movesrwth/$1:travis-debug
;;
*Release*)
docker commit $1 movesrwth/$1:travis
docker push movesrwth/$1:travis
;;
*)
echo "Unrecognized value of CONFIG: $CONFIG"; exit 1
;;
esac
;;
osx)
echo "Docker deployment on Mac OSX not used."
exit 1
;;
*)
# Unknown OS
echo "Unsupported OS: $OS"
exit 1
esac
Loading…
Cancel
Save