File tree 4 files changed +27
-7
lines changed
4 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,16 @@ set -e
17
17
18
18
pushd .docker
19
19
20
+ source $( git rev-parse --show-toplevel) /.ci/travis/scripts/travis_envvar_helper.sh
21
+
22
+
23
+ DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo " true" || echo " false" )
24
+ DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ ' [docker] update dependencies' ]] && echo " true" || echo " false" )
25
+ # on cron job, QGIS image is built and push without testing
26
+ DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
27
+ QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds
28
+
29
+
20
30
echo " travis_fold:start:travis_env"
21
31
echo " ${bold}${endbold} "
22
32
echo " TRAVIS_BRANCH: $TRAVIS_BRANCH "
@@ -33,7 +43,7 @@ echo "travis_fold:end:travis_env"
33
43
echo " travis_fold:start:docker_build"
34
44
echo " ${bold} Docker build deps${endbold} "
35
45
docker --version
36
- if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
46
+ if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 0 ]]; then
37
47
docker-compose --version
38
48
docker-compose -f $DOCKER_COMPOSE config
39
49
fi
Original file line number Diff line number Diff line change 15
15
16
16
set -e
17
17
18
+ source $( git rev-parse --show-toplevel) /.ci/travis/scripts/travis_envvar_helper.sh
18
19
20
+ DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
19
21
20
22
mkdir -p $CCACHE_DIR
21
23
22
- if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ true ]]; then
24
+ if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 1 ]]; then
23
25
DIR=$( git rev-parse --show-toplevel) /.docker
24
26
pushd ${DIR}
25
27
echo " ${bold} Building QGIS Docker image '${DOCKER_TAG} '...${endbold} "
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ function create_qgis_image {
4
+
5
+ if [[ ! $TRAVIS_REPO_SLUG =~ qgis/QGIS ]]; then
6
+ return 0
7
+ fi
8
+ if [[ $TRAVIS_EVENT_TYPE =~ cron ]] || [[ -n $TRAVIS_TAG ]]; then
9
+ return 1;
10
+ fi
11
+ return 0;
12
+ }
Original file line number Diff line number Diff line change 8
8
env :
9
9
- TRAVIS_CONFIG=linux
10
10
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
11
+ # TRAVIS_BRANCH is either the git tag or the branch name when no tag
11
12
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
12
- - DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo "true" || echo "false" )
13
- - DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ '[docker] update dependencies' ]] && echo "true" || echo "false" )
14
- # on cron job, QGIS image is built and push without testing
15
- - DOCKER_QGIS_IMAGE_BUILD_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ cron ]] && echo "true" || echo "false" )
16
- - QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds
17
13
- TRAVIS_TIMESTAMP=$(date +%s)
18
14
- CCACHE_DIR=${HOME}/.ccache
19
15
dist : trusty
You can’t perform that action at this time.
0 commit comments