Skip to content
Permalink
Browse files

[docker] simpler configuration to provide different build options

  • Loading branch information
3nids committed Nov 16, 2018
1 parent 6a9db5a commit 51e767265d3f4c21bd660de1cea1d1199c1c380b

This file was deleted.

This file was deleted.

@@ -25,7 +25,6 @@ DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYP
DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ '[docker] update dependencies' ]] && echo "true" || echo "false" )
# on cron job, QGIS image is built and push without testing
DOCKER_QGIS_IMAGE_BUILD_PUSH=$(create_qgis_image)
QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds


echo "travis_fold:start:travis_env"
@@ -36,18 +35,17 @@ echo "DOCKER_TAG: $DOCKER_TAG"
echo "TRAVIS_COMMIT_MESSAGE: $TRAVIS_COMMIT_MESSAGE"
echo "DOCKER_DEPS_PUSH: $DOCKER_DEPS_PUSH"
echo "DOCKER_DEPS_IMAGE_REBUILD: $DOCKER_DEPS_IMAGE_REBUILD"
echo "DOCKER_QGIS_IMAGE_BUILD_PUSH: $DOCKER_QGIS_IMAGE_BUILD_PUSH"
echo "QGIS_LAST_BUILD_SUCCESS: $QGIS_LAST_BUILD_SUCCESS"
echo "DOCKER_BUILD_QGIS_IMAGE: $DOCKER_BUILD_QGIS_IMAGE"
echo "TRAVIS_TIMESTAMP: $TRAVIS_TIMESTAMP"
echo "travis_fold:end:travis_env"


echo "travis_fold:start:docker_build"
echo "${bold}Docker build deps${endbold}"
docker --version
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
if [[ $DOCKER_BUILD_QGIS_IMAGE =~ false ]]; then
docker-compose --version
docker-compose -f "${DOCKER_COMPOSE}" config
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml config
fi

if [[ $DOCKER_DEPS_IMAGE_REBUILD =~ true ]]; then
@@ -22,7 +22,7 @@ DOCKER_QGIS_IMAGE_BUILD_PUSH=$(create_qgis_image)

mkdir -p "$CCACHE_DIR"

if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ true ]]; then
if [[ DOCKER_BUILD_QGIS_IMAGE =~ true ]]; then
DIR=$(git rev-parse --show-toplevel)/.docker
pushd "${DIR}"
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"

This file was deleted.

@@ -10,27 +10,37 @@ cache:
- $HOME/.ccache
timeout: 1000

global:
env:
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache

matrix:
fast_finish: true
include:

##########################################################
#
# TESTS FOR STANDARD COMMITS
#
##########################################################

##########################################################
# QGIS TESTS ON BIONIC
##########################################################
- os: linux
if: type != cron
services: docker
env:
- TRAVIS_CONFIG=linux
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
# TRAVIS_BRANCH is either the git tag or the branch name when no tag
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache
if: type!=cron
- DOCKER_BUILD_QGIS_IMAGE=false

##########################################################
# CODE LAYOUT
##########################################################

- os: linux
if: type != cron
env:
- TRAVIS_CONFIG=code_layout
addons:
@@ -68,46 +78,36 @@ matrix:



##########################################################
#
# DOCKER IMAGE BUILD JOBS ON CRON
#
##########################################################



##########################################################
#
# DOCKER IMAGE BUILD JOBS ON CRON OR TAG
#
##########################################################


##########################################################
# BIONIC DOCKER BUILD ON CRON
# BIONIC DOCKER BUILD ON CRON OR TAG
##########################################################
- os: linux
if: repo = qgis/QGIS AND (tag IS PRESENT OR type = cron)
services: docker
env:
- TRAVIS_CONFIG=linux
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
# TRAVIS_BRANCH is either the git tag or the branch name when no tag
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache
- DOCKER_TAG=$( echo $TRAVIS_BRANCH | sed 's/master/latest/' )
- DOCKER_DEBIAN_DISTRO=bionic
if: type=cron
- DOCKER_BUILD_QGIS_IMAGE=true

##########################################################
# COSMIC DOCKER BUILD ON CRON
# COSMIC DOCKER BUILD ON CRON OR TAG
##########################################################
- os: linux
if: repo = qgis/QGIS AND (tag IS PRESENT OR type = cron)
services: docker
env:
- TRAVIS_CONFIG=linux
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
# TRAVIS_BRANCH is either the git tag or the branch name when no tag
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache
- DOCKER_TAG=$( echo $TRAVIS_BRANCH | sed 's/master/latest/' )
- DOCKER_DEBIAN_DISTRO=cosmic
if: type=cron

- DOCKER_BUILD_QGIS_IMAGE=true



@@ -134,7 +134,6 @@ notifications:
on_success: change
skip_join: true

notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/467e3aff72e344d1dae3
@@ -153,6 +152,3 @@ before_script:

script:
- ./.ci/travis/${TRAVIS_CONFIG}/script.sh

after_script:
- ./.ci/travis/${TRAVIS_CONFIG}/after_script.sh

0 comments on commit 51e7672

Please sign in to comment.
You can’t perform that action at this time.