QGIS/.ci/travis/linux/before_script.sh
Denis Rouzaud ce109eac98
Revert "use second Dockerfile to push 2nd image"
This reverts commit 050682a37364e110f350b9c3293f662b0011036d.
2017-09-28 13:22:30 +02:00

35 lines
1.5 KiB
Bash
Executable File

###########################################################################
# before_script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
pushd .docker
docker --version
docker-compose --version
docker-compose -f $DOCKER_COMPOSE config
#docker pull ubuntu:16.04
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" .
# image should be pushed even if QGIS build fails
# but push is achieved only on branches (not for PRs)
if [[ $DOCKER_PUSH =~ true ]]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
#docker tag "qgis/qgis3-build-deps:${DOCKER_TAG}" "qgis/qgis3-build-deps:latest"
docker push "qgis/qgis3-build-deps:${DOCKER_TAG}"
fi
popd