2018-06-05 11:22:18 +02:00
|
|
|
#!/usr/bin/env bash
|
2016-06-03 10:16:00 +02:00
|
|
|
###########################################################################
|
|
|
|
# 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. #
|
|
|
|
# #
|
|
|
|
###########################################################################
|
|
|
|
|
2017-08-05 00:03:33 +02:00
|
|
|
set -e
|
2016-02-17 11:29:49 +01:00
|
|
|
|
2018-11-19 10:22:13 +01:00
|
|
|
DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ "${TRAVIS_EVENT_TYPE}" != "pull_request" ]] && echo "true" || echo "false" )
|
2018-03-13 08:14:44 -08:00
|
|
|
|
2019-03-05 17:38:04 +01:00
|
|
|
.ci/travis/scripts/echo_travis_var.sh
|
2018-02-27 09:16:02 -09:00
|
|
|
|
2019-03-05 17:38:04 +01:00
|
|
|
pushd .docker
|
2018-02-27 09:16:02 -09:00
|
|
|
|
|
|
|
echo "travis_fold:start:docker_build"
|
|
|
|
echo "${bold}Docker build deps${endbold}"
|
2017-08-05 00:03:33 +02:00
|
|
|
docker --version
|
2019-03-05 17:38:04 +01:00
|
|
|
docker-compose --version
|
2019-03-07 14:59:25 +01:00
|
|
|
docker-compose -f ${TRAVIS_BUILD_DIR}/.ci/travis/linux/docker-compose.travis.yml config
|
2019-03-05 17:38:04 +01:00
|
|
|
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}" -f ${DOCKER_BUILD_DEPS_FILE} .
|
2018-02-27 09:16:02 -09:00
|
|
|
echo "travis_fold:end:docker_build"
|
|
|
|
|
|
|
|
echo "travis_fold:start:docker_push"
|
|
|
|
echo "${bold}Docker push deps${endbold}"
|
2017-08-05 00:03:33 +02:00
|
|
|
# image should be pushed even if QGIS build fails
|
|
|
|
# but push is achieved only on branches (not for PRs)
|
2018-02-27 09:16:02 -09:00
|
|
|
if [[ $DOCKER_DEPS_PUSH =~ true ]]; then
|
|
|
|
echo "push to qgis/qgis3-build-deps:${DOCKER_TAG}"
|
2017-08-05 00:03:33 +02:00
|
|
|
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
|
|
|
|
docker push "qgis/qgis3-build-deps:${DOCKER_TAG}"
|
|
|
|
fi
|
2018-02-27 09:16:02 -09:00
|
|
|
echo "travis_fold:end:docker_push"
|
2017-08-05 00:03:33 +02:00
|
|
|
|
|
|
|
popd
|