Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6896ea2

Browse files
committedFeb 20, 2018
build QGIS Docker on cron jobs
1 parent 7855836 commit 6896ea2

File tree

6 files changed

+38
-31
lines changed

6 files changed

+38
-31
lines changed
 

‎.ci/travis/linux/before_script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
2626
if [[ $DOCKER_DEPS_IMAGE_REBUILD =~ true ]]; then
2727
docker build --no-cache -t "qgis/qgis3-build-deps:${DOCKER_TAG}" .
2828
else
29-
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" .
29+
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f qgis3-build-deps.dockerfile .
3030
fi
3131
echo "travis_fold:end:docker"
3232
# image should be pushed even if QGIS build fails
3333
# but push is achieved only on branches (not for PRs)
34-
if [[ $DOCKER_PUSH =~ true ]]; then
34+
if [[ $DOCKER_DEPS_PUSH =~ true ]]; then
3535
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
3636
#docker tag "qgis/qgis3-build-deps:${DOCKER_TAG}" "qgis/qgis3-build-deps:latest"
3737
docker push "qgis/qgis3-build-deps:${DOCKER_TAG}"

‎.ci/travis/linux/script.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@
1515

1616
set -e
1717

18-
DIR=$(git rev-parse --show-toplevel)/.docker
18+
1919

2020
mkdir -p $CCACHE_DIR
2121

22-
docker-compose -f $DOCKER_COMPOSE run --rm qgis-deps
22+
if [[ $DOCKER_QGIS_IMAGE_PUSH =~ true ]]; then
23+
DIR=$(git rev-parse --show-toplevel)/.docker
24+
pushd ${DIR}
25+
echo "${bold}Building QGIS Docker image...${endbold}"
26+
docker build -v /root/QGIS:/root/QGIS --cache-from "qgis/qgis:${DOCKER_TAG}" -t "qgis/qgis:${DOCKER_TAG}" -f qgis.dockerfile .
27+
if [[ $DOCKER_QGIS_IMAGE_PUSH =~ true ]]; then
28+
echo "${bold}Pushing image to docker hub...${endbold}"
29+
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
30+
docker push "qgis/qgis:${DOCKER_TAG}"
31+
fi
32+
popd
33+
else
34+
docker-compose -f $DOCKER_COMPOSE run --rm qgis-deps
35+
fi

‎.docker/Dockerfile-build-test

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎Dockerfile renamed to ‎.docker/qgis.dockerfile

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,23 @@ COPY . /usr/src/QGIS
1717
WORKDIR /usr/src/QGIS/build
1818

1919
RUN cmake \
20-
-GNinja \
21-
-DCMAKE_BUILD_TYPE=Release \
22-
-DCMAKE_INSTALL_PREFIX=/usr \
23-
-DBINDINGS_GLOBAL_INSTALL=ON \
24-
-DWITH_STAGED_PLUGINS=ON \
25-
-DWITH_GRASS=ON \
26-
-DWITH_3D=ON \
27-
-DSUPPRESS_QT_WARNINGS=ON \
28-
-DENABLE_TESTS=OFF \
29-
-DWITH_QSPATIALITE=ON \
30-
-DWITH_QWTPOLAR=OFF \
31-
-DWITH_APIDOC=OFF \
32-
-DWITH_ASTYLE=OFF \
33-
-DWITH_DESKTOP=ON \
34-
-DWITH_BINDINGS=ON \
35-
-DDISABLE_DEPRECATED=ON \
20+
-GNinja \
21+
-DCMAKE_BUILD_TYPE=Release \
22+
-DCMAKE_INSTALL_PREFIX=/usr \
23+
-DWITH_DESKTOP=OFF \
24+
-DWITH_SERVER=ON \
25+
-DWITH_3D=ON \
26+
-DWITH_BINDINGS=ON \
27+
-DBINDINGS_GLOBAL_INSTALL=ON \
28+
-DWITH_STAGED_PLUGINS=ON \
29+
-DWITH_GRASS=ON \
30+
-DSUPPRESS_QT_WARNINGS=ON \
31+
-DDISABLE_DEPRECATED=ON \
32+
-DENABLE_TESTS=OFF \
33+
-DWITH_QSPATIALITE=ON \
34+
-DWITH_QWTPOLAR=OFF \
35+
-DWITH_APIDOC=OFF \
36+
-DWITH_ASTYLE=OFF \
3637
.. \
3738
&& ninja install \
3839
&& rm -rf /usr/src/QGIS
File renamed without changes.

‎.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ matrix:
99
- TRAVIS_CONFIG=linux
1010
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
1111
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
12-
- DOCKER_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_PULL_REQUEST =~ false ]] && echo "true" || echo "false" )
12+
- DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_PULL_REQUEST =~ false ]] && echo "true" || echo "false" )
1313
- 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_PUSH=$( [[ $TRAVIS_EVENT_TYPE =~ cron ]] && echo "true" || echo "true" ) # TODO: else false
16+
- QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds
1417
- CCACHE_DIR=${HOME}/.ccache
1518
dist: trusty
1619
sudo: false

0 commit comments

Comments
 (0)
Please sign in to comment.