summaryrefslogtreecommitdiff
path: root/.travis.yml
diff options
context:
space:
mode:
authorOmar Padron <omar.padron@kitware.com>2018-10-26 13:15:05 -0400
committerTodd Gamblin <tgamblin@llnl.gov>2018-10-26 10:15:05 -0700
commitaa1c814c7592c9e71f564181af3a8f2a115bd304 (patch)
tree7071718f8c473e9393c28211ca5d17634e6c43aa /.travis.yml
parent734d903b0313e70f5d22959fdc34432643120d46 (diff)
downloadspack-aa1c814c7592c9e71f564181af3a8f2a115bd304.tar.gz
spack-aa1c814c7592c9e71f564181af3a8f2a115bd304.tar.bz2
spack-aa1c814c7592c9e71f564181af3a8f2a115bd304.tar.xz
spack-aa1c814c7592c9e71f564181af3a8f2a115bd304.zip
docker: unite Dockerfiles; auto-deploy images to DockerHub (#9329)
* Unite Dockerfiles - add build/run/push scripts * update docker documentation * update .travis.yml * switch to using a preprocessor on Dockerfiles * skip building docker images on pull requests * update files with copyright info * tweak when travis builds for docker files are done
Diffstat (limited to '.travis.yml')
-rw-r--r--.travis.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 34d8e5c3d3..d9216fed87 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -108,6 +108,11 @@ jobs:
os: linux
language: python
env: [ TEST_SUITE=build, 'SPEC=mpich' ]
+ - stage: 'docker build'
+ sudo: required
+ os: linux
+ language: generic
+ env: TEST_SUITE=docker
allow_failures:
- dist: xenial
@@ -115,6 +120,8 @@ stages:
- 'style checks'
- 'unit tests + documentation'
- 'build tests'
+ - name: 'docker build'
+ if: type = push AND branch IN (develop, master)
#=============================================================================
@@ -187,8 +194,29 @@ before_script:
#=============================================================================
# Building
#=============================================================================
+services:
+ - docker
+
script:
- share/spack/qa/run-$TEST_SUITE-tests
+ - if [[ "$TEST_SUITE" == "docker build" ]]; then
+ login_attempted=0; login_success=0;
+ for config in share/spack/docker/config/* ; do
+ source "$config" ;
+ ./share/spack/docker/build-image.sh;
+ if [ "$TRAVIS_EVENT_TYPE" != "pull_request" ]; then
+ if [ "$login_attempted" '=' '0' ]; then
+ if echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; then
+ login_success=1;
+ fi;
+ login_attempted=1;
+ fi;
+ if [ "$login_success" '=' '1' ]; then
+ ./share/spack/docker/push-image.sh;
+ fi
+ fi
+ done;
+ fi
- if [[ "$TEST_SUITE" == "unit" || "$TEST_SUITE" == "build" ]]; then
codecov --env PYTHON_VERSION
--required --flags "${TEST_SUITE}${TRAVIS_OS_NAME}";