Skip to content

Commit

Permalink
Merge branch 'master' into refFunctionsRebase
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierdalang committed Sep 9, 2020
2 parents 5213b15 + d6666c0 commit 723a6ef
Show file tree
Hide file tree
Showing 661 changed files with 13,783 additions and 3,800 deletions.
15 changes: 0 additions & 15 deletions .ci/travis/docker_image/before_install.sh

This file was deleted.

39 changes: 0 additions & 39 deletions .ci/travis/docker_image/before_script.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .ci/travis/docker_image/install.sh

This file was deleted.

95 changes: 0 additions & 95 deletions .ci/travis/docker_image/script.sh

This file was deleted.

27 changes: 12 additions & 15 deletions .docker/qgis.dockerfile
@@ -1,18 +1,18 @@

# see https://docs.docker.com/docker-cloud/builds/advanced/
# using ARG in FROM requires min v17.05.0-ce
ARG DOCKER_TAG=latest
ARG DOCKER_DEPS_TAG=latest

FROM qgis/qgis3-build-deps:${DOCKER_TAG} AS BUILDER
FROM qgis/qgis3-build-deps:${DOCKER_DEPS_TAG} AS BUILDER
MAINTAINER Denis Rouzaud <denis@opengis.ch>

LABEL Description="Docker container with QGIS" Vendor="QGIS.org" Version="1.1"

# build timeout in seconds, so no timeout by default
ARG BUILD_TIMEOUT=360000

ARG CC=/usr/lib/ccache/clang
ARG CXX=/usr/lib/ccache/clazy
ARG CC=/usr/lib/ccache/gcc
ARG CXX=/usr/lib/ccache/g++
ENV LANG=C.UTF-8

COPY . /QGIS
Expand All @@ -28,7 +28,8 @@ RUN echo "ccache_dir: "$(du -h --max-depth=0 ${CCACHE_DIR})

WORKDIR /QGIS/build

RUN cmake \
RUN SUCCESS=OK \
&& cmake \
-GNinja \
-DUSE_CCACHE=OFF \
-DCMAKE_BUILD_TYPE=Release \
Expand All @@ -49,20 +50,16 @@ RUN cmake \
-DWITH_ASTYLE=OFF \
-DQT5_3DEXTRA_LIBRARY="/usr/lib/x86_64-linux-gnu/libQt53DExtras.so" \
-DQT5_3DEXTRA_INCLUDE_DIR="/QGIS/external/qt3dextra-headers" \
-DCMAKE_PREFIX_PATH="/QGIS/external/qt3dextra-headers/cmake" \
.. \
&& echo "Timeout: ${BUILD_TIMEOUT}s" \
&& SUCCESS=OK \
&& timeout ${BUILD_TIMEOUT}s ninja install || SUCCESS=TIMEOUT \
&& echo "$SUCCESS" > /QGIS/build_exit_value

-DQt53DExtras_DIR="/QGIS/external/qt3dextra-headers/cmake/Qt53DExtras" \
-DCMAKE_PREFIX_PATH="/QGIS/external/qt3dextra-headers" \
.. \
&& ninja install || SUCCESS=FAILED \
&& echo "$SUCCESS" > /QGIS/build_exit_value

# Additional run-time dependencies
RUN pip3 install jinja2 pygments

################################################################################
ARG DELETE_CACHE=FALSE
RUN if [[ ${DELETE_CACHE} == TRUE ]]; then rm /QGIS; fi

# Python testing environment setup

# Add QGIS test runner
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Expand Up @@ -13,7 +13,7 @@ by running the prepare commit script **before** issuing `git commit`.

This can be automated by setting up the pre-commit hook properly.

ln -s $PWD/scripts/prepare_commit.sh ./.git/hooks/pre-commit
ln -s ../../scripts/prepare_commit.sh .git/hooks/pre-commit

Getting your pull request merged
--------------------------------
Expand Down
123 changes: 123 additions & 0 deletions .github/workflows/build-docker.yml
@@ -0,0 +1,123 @@
name: Build Docker images for current branches

on:
schedule:
# runs every day
- cron: '0 0 * * *'
workflow_dispatch:
# POST https://api.github.com/repos/qgis/QGIS/actions/workflows/2264135/dispatches:

jobs:
build-docker:
runs-on: ubuntu-latest

env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
CC: /usr/lib/ccache/gcc
CXX: /usr/lib/ccache/g++ # Building SIP binding freezes with Clang in Docker, maybe a SIP issue, maybe not

strategy:
matrix:
branch: [master, release-3_10, release-3_14]

steps:
- name: Cache
id: cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: docker-build-${{ matrix.branch }}

- name: checkout ${branch}
uses: actions/checkout@v2
with:
ref: ${{ matrix.branch }}

- name: Build QGIS Docker image for branch ${{ matrix.branch }}
env:
branch: ${{ matrix.branch }}
run: |
export DOCKER_TAG=${branch//master/latest}
export DOCKER_BUILD_DEPS_FILE=qgis3-build-deps-focal.dockerfile
export DOCKER_DEPS_TAG=${DOCKER_TAG}_focal
echo "branch: ${branch}"
echo "docker tag: ${DOCKER_TAG}"
echo "docker deps tag: ${DOCKER_DEPS_TAG}"
[[ -d ~/.ccache ]] && echo "cache directory (~/.ccache) exists" || mkdir -p ~/.ccache
# copy ccache dir within QGIS source so it can be accessed from docker
cp -r ~/.ccache/. ./.ccache_image_build
echo "##[group] QGIS deps Docker pull/rebuild"
cd .docker
docker --version
docker pull "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}" -f ${DOCKER_BUILD_DEPS_FILE} .
echo "push to qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis3-build-deps:${DOCKER_DEPS_TAG}"
echo "##[endgroup]"
echo "##[group] Docker QGIS build"
DOCKER_BUILD_ARGS="--build-arg DOCKER_DEPS_TAG --build-arg CC --build-arg CXX"
docker build ${DOCKER_BUILD_ARGS} \
--cache-from "qgis/qgis:${DOCKER_TAG}" \
-t "qgis/qgis:BUILDER" \
-f qgis.dockerfile ..
echo "##[endgroup]"
echo "##[group] Tag container and copy cache"
docker run --name qgis_container qgis/qgis:BUILDER /bin/true
docker cp qgis_container:/QGIS/build_exit_value ./build_exit_value
if [[ $(cat ./build_exit_value) -ne "OK" ]]; then
echo "Build failed, not pushing image"
exit 1
fi
echo "Copy build cache from Docker container to Travis cache directory"
rm -rf ~/.ccache/*
mkdir -p ~/.ccache
docker cp qgis_container:/QGIS/.ccache_image_build/. ~/.ccache
echo "Cache size: "$(du -sh ~/.ccache)
echo "##[endgroup]"
echo "##[group] Finalize image"
# enable experimental features in Docker to squash
echo '{ "experimental": true}' | sudo tee /etc/docker/daemon.json
sudo service docker restart
docker build ${DOCKER_BUILD_ARGS} \
--cache-from "qgis/qgis:BUILDER" \
--squash \
-t "qgis/qgis:${DOCKER_TAG}" \
-f qgis.dockerfile ..
echo "##[endgroup]"
echo "##[group] Pushing image to docker hub"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis:${DOCKER_TAG}"
echo "##[endgroup]"
- name: Trigger PyQGIS API docs build for ${{ matrix.branch }}
if: success()
env:
branch: ${{ matrix.branch }}
run: |
echo "##[group] Trigger build of PyQGIS Documentation"
body='{
"ref": "master",
"inputs": {"qgis_branch": "__QGIS_VERSION_BRANCH__"}
}'
body=$(sed "s/__QGIS_VERSION_BRANCH__/${TRAVIS_BRANCH}/;" <<< $body)
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GH_TOKEN}" \
https://api.github.com/repos/qgis/pyqgis/actions/workflows/2246440/dispatches \
-d "${body}"
echo "##[endgroup]"

0 comments on commit 723a6ef

Please sign in to comment.