Skip to content

Commit fe6654e

Browse files
committed
fix docker variables in Travis (take 2)
1 parent 0fa1f04 commit fe6654e

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.ci/travis/linux/before_script.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.
2323
DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo "true" || echo "false" )
2424
DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ '[docker] update dependencies' ]] && echo "true" || echo "false" )
2525
# on cron job, QGIS image is built and push without testing
26-
DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
26+
DOCKER_QGIS_IMAGE_BUILD_PUSH=$(create_qgis_image)
2727
QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds
2828

2929

@@ -43,7 +43,7 @@ echo "travis_fold:end:travis_env"
4343
echo "travis_fold:start:docker_build"
4444
echo "${bold}Docker build deps${endbold}"
4545
docker --version
46-
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 0 ]]; then
46+
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
4747
docker-compose --version
4848
docker-compose -f $DOCKER_COMPOSE config
4949
fi

.ci/travis/linux/script.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ set -e
1717

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

20-
DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
20+
DOCKER_QGIS_IMAGE_BUILD_PUSH=$(create_qgis_image)
2121

2222
mkdir -p $CCACHE_DIR
2323

24-
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 1 ]]; then
24+
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ true ]]; then
2525
DIR=$(git rev-parse --show-toplevel)/.docker
2626
pushd ${DIR}
2727
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
+6-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
#!/usr/bin/env bash
22

3-
function create_qgis_image {
3+
create_qgis_image () {
44

55
if [[ ! $TRAVIS_REPO_SLUG =~ qgis/QGIS ]]; then
6-
return 0
6+
echo false
7+
return
78
fi
89
if [[ $TRAVIS_EVENT_TYPE =~ cron ]] || [[ -n $TRAVIS_TAG ]]; then
9-
return 1;
10+
echo true
11+
return
1012
fi
11-
return 0;
13+
echo false
1214
}

0 commit comments

Comments
 (0)