QGIS/.ci/travis/linux/script.sh

40 lines
1.7 KiB
Bash
Raw Normal View History

2016-06-03 10:16:00 +02:00
###########################################################################
# script.sh
# ---------------------
2016-09-27 13:35:50 +02:00
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
2016-06-03 10:16:00 +02:00
###########################################################################
# #
# 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-09-06 10:46:47 +02:00
set -e
source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.sh
DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
2016-03-10 18:55:06 +01:00
2017-08-07 17:08:40 +02:00
mkdir -p $CCACHE_DIR
2016-10-19 17:11:04 +03:00
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 1 ]]; then
DIR=$(git rev-parse --show-toplevel)/.docker
pushd ${DIR}
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
docker build --build-arg CACHE_DIR=/root/.ccache \
--build-arg DOCKER_TAG=${DOCKER_TAG} \
--cache-from "qgis/qgis:${DOCKER_TAG}" \
-t "qgis/qgis:${DOCKER_TAG}" \
-f qgis.dockerfile ..
echo "${bold}Pushing image to docker hub...${endbold}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis:${DOCKER_TAG}"
popd
else
docker-compose -f $DOCKER_COMPOSE run --rm qgis-deps
fi