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
This commit is contained in:
Omar Padron
2018-10-26 13:15:05 -04:00
committed by Todd Gamblin
parent 734d903b03
commit aa1c814c75
27 changed files with 483 additions and 418 deletions

View File

@@ -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}";