blob: d7d328553da7f1ad4f2654af36e12fd9d3efd4c0 (
plain) (
tree)
|
|
#!/bin/bash -e
#
# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
#
# Description:
# Runs Spack docker tests. This builds a docker image for each of the
# configurations in share/spack/docker/config.
#
# Usage:
# run-docker-tests
#
__login_attempted=0
__login_success=1
ensure_docker_login() {
if [ "$__login_attempted" '!=' '0' ] ; then
return $__login_success
fi
echo "$DOCKER_PASSWORD" | \
docker login -u "$DOCKER_USERNAME" --password-stdin
if [ $? '=' '0' ] ; then
__login_success=0
fi
__login_attempted=1
return $__login_success
}
for config in share/spack/docker/config/* ; do
source "$config" ;
./share/spack/docker/build-image.sh;
done
if [ "$TEST_SUITE" '=' "docker build" -a \
"$TRAVIS_EVENT_TYPE" != "pull_request" -a \
ensure_docker_login ] ; then
for config in share/spack/docker/config/* ; do
source "$config"
./share/spack/docker/push-image.sh
done
fi
|