Skip to content

Commit

Permalink
fix docker variables in Travis (take 2)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed Mar 21, 2018
1 parent 66c8a85 commit c752e15
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .ci/travis/linux/before_script.sh
Expand Up @@ -23,7 +23,7 @@ source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.
DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo "true" || echo "false" )
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
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


Expand All @@ -43,7 +43,7 @@ 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 -eq 0 ]]; then
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
docker-compose --version
docker-compose -f $DOCKER_COMPOSE config
fi
Expand Down
4 changes: 2 additions & 2 deletions .ci/travis/linux/script.sh
Expand Up @@ -17,11 +17,11 @@ set -e

source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.sh

DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
DOCKER_QGIS_IMAGE_BUILD_PUSH=$(create_qgis_image)

mkdir -p $CCACHE_DIR

if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 1 ]]; then
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ true ]]; then
DIR=$(git rev-parse --show-toplevel)/.docker
pushd ${DIR}
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
Expand Down
10 changes: 6 additions & 4 deletions .ci/travis/scripts/travis_envvar_helper.sh
@@ -1,12 +1,14 @@
#!/usr/bin/env bash

function create_qgis_image {
create_qgis_image () {

if [[ ! $TRAVIS_REPO_SLUG =~ qgis/QGIS ]]; then
return 0
echo false
return
fi
if [[ $TRAVIS_EVENT_TYPE =~ cron ]] || [[ -n $TRAVIS_TAG ]]; then
return 1;
echo true
return
fi
return 0;
echo false
}

0 comments on commit c752e15

Please sign in to comment.