Deploy docker images in Travis

This commit is contained in:
Lee Bousfield 2018-02-03 18:30:08 -07:00 committed by androm3da
commit f392038d1d
4 changed files with 26 additions and 8 deletions

View file

@ -34,10 +34,16 @@ compiler:
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo mkdir -p /etc/docker && echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json && sudo service docker restart; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install qt5 && brew cask install xquartz && brew upgrade boost && brew install rust; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker pull lukealonso/raiblocks-ci:latest; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then travis_wait 40 ci/build-docker-image.sh docker/ci/Dockerfile nanocurrency/nano-ci; fi
script:
- if [ -n "$ONE_TIME_TESTS" ]; then ci/check-commit-format.sh; fi
- if [ -n "$ONE_TIME_TESTS" ]; then doxygen doxygen.config; fi # TODO also deploy the built HTML
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then ci/build-travis.sh "/usr/local/opt/qt5/lib/cmake/Qt5"; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run -v $TRAVIS_BUILD_DIR:/workspace lukealonso/raiblocks-ci:latest /bin/bash -c "cd /workspace && ASAN=${ASAN} TSAN=${TSAN} ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"; fi
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then docker run -v $TRAVIS_BUILD_DIR:/workspace nanocurrency/nano-ci /bin/bash -c "cd /workspace && ASAN=${ASAN} TSAN=${TSAN} ./ci/build-travis.sh /usr/lib/x86_64-linux-gnu/cmake/Qt5 ${PWD}"; fi
deploy:
provider: script
script: travis_wait 80 ci/deploy-docker.sh
on:
condition: -n "$ONE_TIME_TESTS"

7
ci/build-docker-image.sh Executable file
View file

@ -0,0 +1,7 @@
#!/bin/bash
set -eu
docker pull "$2" || true
echo "Building $2"
# Output for the build is WAY too long for Travis logs
docker build -f "$1" -t "$2" --cache-from "$2" . > /dev/null 2>&1

View file

@ -48,12 +48,6 @@ else
TRUE_CMD=true
fi
if ! cargo --version &>/dev/null; then
# We'll update the docker image once this PR gets merged.
# If you're reading this comment on master, contact @PlasmaPower
apt-get update && apt-get install -yq cargo
fi
pushd load-tester
cargo build --release
popd

11
ci/deploy-docker.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
set -eu
docker login -u nanocurrency -p "$DOCKER_PASSWORD"
# We push this just so it can be a cache next time
docker push nanocurrency/nano-ci
# We don't need to build this unless we're deploying it
ci/build-docker-image.sh docker/node/Dockerfile nanocurrency/nano
docker push nanocurrency/nano