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

39 lines
1.6 KiB
Bash
Raw Normal View History

2018-06-05 11:22:18 +02:00
#!/usr/bin/env bash
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
2018-06-21 12:49:45 +10:00
mkdir -p "$CCACHE_DIR"
2016-10-19 17:11:04 +03:00
2018-11-16 18:44:00 +01:00
if [[ ${DOCKER_BUILD_QGIS_IMAGE} =~ true ]]; then
2018-11-16 18:28:33 +01:00
# building docker images
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 \
2018-06-21 12:49:45 +10:00
--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
2018-11-16 18:28:33 +01:00
# running tests
2018-11-16 18:44:00 +01:00
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run --rm qgis-deps
fi