Skip to content
Permalink
Browse files

add a second cache directory for Docker image building

because they just take too much time
  • Loading branch information
3nids committed Mar 5, 2019
1 parent 13f8bc7 commit b249fc14e5b0177b6f0a8b9b068fd0443f809d42
Showing with 21 additions and 14 deletions.
  1. +14 −10 .ci/travis/linux/script.sh
  2. +1 −1 .docker/docker-compose.travis.yml
  3. +2 −1 .docker/qgis.dockerfile
  4. +4 −2 .travis.yml
@@ -20,7 +20,7 @@ mkdir -p "$CCACHE_DIR"

if [[ ${DOCKER_BUILD_QGIS_IMAGE} =~ true ]]; then
# copy ccache dir within QGIS source so it can be accessed from docker
cp -r ${CCACHE_DIR} ${TRAVIS_BUILD_DIR}/.ccache
cp -r ${CCACHE_DIR_IMAGE_BUILD} ${TRAVIS_BUILD_DIR}/.ccache_image_build
# building docker images
DIR=$(git rev-parse --show-toplevel)/.docker
pushd "${DIR}"
@@ -32,20 +32,24 @@ if [[ ${DOCKER_BUILD_QGIS_IMAGE} =~ true ]]; then
echo "${bold}Pushing image to docker hub...${endbold}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis:${DOCKER_TAG}"
echo "Copy build cache from Docker container to Travis cache directory"
rm -rf ${CCACHE_DIR_IMAGE_BUILD}/*
container_id=$(docker images -q "qgis/qgis:${DOCKER_TAG}")
docker cp ${container_id}:/usr/src/QGIS/.ccache_image_build ${CCACHE_DIR_IMAGE_BUILD}
popd
echo "Trigger build of PyQGIS Documentation"
body='{
"request": {
"branch":"master",
"message": "Trigger PyQGIS doc build after release of new Docker image",
"config": {
"merge_mode": "deep_merge",
"env": {
"global": ["QGIS_VERSION_BRANCH=release-3_4"]
body="{
'request': {
'branch':'master',
'message': 'Trigger PyQGIS doc build after release of new Docker image as ${DOCKER_TAG}',
'config': {
'merge_mode': 'deep_merge',
'env': {
'global': ['QGIS_VERSION_BRANCH=${TRAVIS_BRANCH}']
}
}
}
}'
}"
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" \
-H "Travis-API-Version: 3" -H "Authorization: token $TRAVIS_TOKEN" -d "$body" \
https://api.travis-ci.org/repo/qgis%2Fpyqgis/requests
@@ -16,7 +16,7 @@ services:
image: qgis/qgis3-build-deps:${DOCKER_TAG}
volumes:
- ${TRAVIS_BUILD_DIR}:/root/QGIS
- ${CCACHE_DIR}:/root/.ccache # if changed, also change env var
- ${CCACHE_DIR_TESTING}:/root/.ccache # if changed, also change env var
links:
- postgres
- mssql
@@ -16,7 +16,8 @@ ENV LANG=C.UTF-8

COPY . /usr/src/QGIS

ENV CCACHE_DIR=/usr/src/QGIS/.ccache
# If this directory is changed, also adapt script.sh which copies the directory
ENV CCACHE_DIR=/usr/src/QGIS/.ccache_image_build
RUN ccache -M 1G
RUN ccache -s

@@ -7,14 +7,16 @@ cache:
apt: true
pip: true
directories:
- ${HOME}/.ccache
- ${HOME}/.ccache_testing
- ${HOME}/.ccache_docker_build
timeout: 1000
if: NOT branch =~ /^(cherry-pick-)?backport-\d+-on-/

env:
global:
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache
- CCACHE_DIR_TESTING=${HOME}/.ccache_testing
- CCACHE_DIR_IMAGE_BUILD=${HOME}/.ccache_docker_build
# Docker hub username and passowrd
- secure: "b7eMDIolaAnq1voGKC1ez7Kcf+/A0WZDJEHBvNwk2KubBfrGOE83GMDrFNF4NqjIprqIAvVKj+TrX1ckCvs24re3IqUJo71TaF1IgxzDDPwSsmNh5UMmvZkeiJys9bWjqDO9wYR5ietNmIE18qyMc8ToJk8oKm6AXuAG2n6znmM="
- secure: "PHCp7F3nApp38Mz6b4/OLxgfBiikRGzPQDHg3R5LX+SQOll24c/DMtwpPwizNuFEiCFcRmJ9uc1t0HWEerIZe5uqm7AtE/nMXBsvDZ+hj4Tz/fEBF98a1k4WLYheN1exFidVkJgdAeiwMOOUQXw5KuIX62bxBdzsdcd0QGwxiXo="

0 comments on commit b249fc1

Please sign in to comment.
You can’t perform that action at this time.