Skip to content

Commit

Permalink
Send CI image to Docker Hub
Browse files Browse the repository at this point in the history
  • Loading branch information
gsfr committed Nov 22, 2017
1 parent a21073e commit 7743faf
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 41 deletions.
26 changes: 16 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,35 @@ services:

env:
global:
- secure: HELJx6WPr+W2S0FV47KkRdlS9NCqlMcdRMK8xWgRqqrEPv24KEvNnHxCy0tRbzITqadYtyvI1MtqtmpG04uty8Gpkc7w6L6LMJ/OuLG0gVX7AnaUovYTlY04m1/L9oyzOrTDXk5J/BKbcyiz7uJtkTc/A8MMZAFfZh7hmhLID78= # BUILD_TRIGGER_URL
- DOCKER_DIR="$HOME/.cache/docker"
- secure: "HhT1TdJcpqys8juVMw/DIZeK7oD4595TEKH5KlowH7MvwwFAUyQFb5W63F8dgk7elvRG+3fmga/m1JfXO+Iu7PVD912eiNDagW9aB3CEl3Z8zg+JUL8IjpMCkyKQDyJMnfOkrzdxdaqfOK+WmF+13f2qBu9Kc7wdXuzgHQrg4+0=" # CI_REGISTRY_USER
- secure: "hh7VDZnkxgl/vqHtS4IpXfIAckKpVQvoCzNW7fstr5Mcu8KNiCWIPgObBRm+m13aqpcFTMWQ6lT2kzORz2wWRbDeVhI1eGWOJswGNHPHZLO0Jaei6yfY2nY2mpxZbl+vdg00jkN64mi1ab3e++QgeLFruW0gyNefXX7E5L/mHTs=" # CI_REGISTRY_PASS

#cache:
# directories:
# - $TESTDATA_DIR
# - $DOCKER_DIR
cache:
directories:
- $DOCKER_DIR

before_install:
- sudo apt-get update
- sudo apt-get -y install docker-ce realpath
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASS

install: true

script:
- test -f "$DOCKER_DIR/image.tar" && docker load -i "$DOCKER_DIR/image.tar" || true
- docker build -t core:build --target build .
- docker build -t core:dist --target dist .
- docker build -t core:testing --target testing .
- docker save -o "$DOCKER_DIR/image.tar" $(docker history -q reaper:build | grep -v '<missing>') $(docker history -q reaper:dist | grep -v '<missing>')
- ./tests/bin/run-tests-docker.sh

after_success:
- if [ "$TRAVIS_BRANCH" == "master" -o "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then
bash <(curl -s https://codecov.io/bash) -cF python;
fi
- if [ "$TRAVIS_TAG" ]; then
./docker/build-trigger.sh Tag "$TRAVIS_TAG" "$BUILD_TRIGGER_URL";
docker tag core:dist scitran/core:$TRAVIS_TAG;
docker push scitran/core:$TRAVIS_TAG;
fi
- if [ "$TRAVIS_EVENT_TYPE" == "push" -a "$TRAVIS_BRANCH" == "master" ]; then
./docker/build-trigger.sh Branch "$TRAVIS_BRANCH" "$BUILD_TRIGGER_URL";
docker tag core:dist scitran/core:latest;
docker push scitran/core:latest;
fi
31 changes: 0 additions & 31 deletions docker/build-trigger.sh

This file was deleted.

0 comments on commit 7743faf

Please sign in to comment.