-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
by separating the testing and docker image building scripts there was almost no redundany in the scripts, it is much clearer now
- Loading branch information
Showing
9 changed files
with
159 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
########################################################################### | ||
# before_install.sh | ||
# --------------------- | ||
# Date : March 2016 | ||
# Copyright : (C) 2016 by Matthias Kuhn | ||
# Email : matthias at opengis dot ch | ||
########################################################################### | ||
# # | ||
# This program is free software; you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License as published by # | ||
# the Free Software Foundation; either version 2 of the License, or # | ||
# (at your option) any later version. # | ||
# # | ||
########################################################################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
########################################################################### | ||
# before_script.sh | ||
# --------------------- | ||
# Date : August 2015 | ||
# Copyright : (C) 2015 by Nyall Dawson | ||
# Email : nyall dot dawson at gmail dot com | ||
########################################################################### | ||
# # | ||
# This program is free software; you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License as published by # | ||
# the Free Software Foundation; either version 2 of the License, or # | ||
# (at your option) any later version. # | ||
# # | ||
########################################################################### | ||
|
||
set -e | ||
|
||
.ci/travis/scripts/echo_travis_var.sh | ||
|
||
pushd .docker | ||
|
||
|
||
|
||
echo "travis_fold:start:docker_build" | ||
echo "${bold}Docker build deps${endbold}" | ||
docker --version | ||
|
||
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true | ||
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f ${DOCKER_BUILD_DEPS_FILE} . | ||
|
||
echo "travis_fold:end:docker_build" | ||
|
||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
########################################################################### | ||
# install.sh | ||
# --------------------- | ||
# Date : March 2016 | ||
# Copyright : (C) 2016 by Matthias Kuhn | ||
# Email : matthias at opengis dot ch | ||
########################################################################### | ||
# # | ||
# This program is free software; you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License as published by # | ||
# the Free Software Foundation; either version 2 of the License, or # | ||
# (at your option) any later version. # | ||
# # | ||
########################################################################### | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
########################################################################### | ||
# script.sh | ||
# --------------------- | ||
# Date : March 2016 | ||
# Copyright : (C) 2016 by Matthias Kuhn | ||
# Email : matthias at opengis dot ch | ||
########################################################################### | ||
# # | ||
# This program is free software; you can redistribute it and/or modify # | ||
# it under the terms of the GNU General Public License as published by # | ||
# the Free Software Foundation; either version 2 of the License, or # | ||
# (at your option) any later version. # | ||
# # | ||
########################################################################### | ||
|
||
set -e | ||
|
||
mkdir -p "CCACHE_DIR_IMAGE_BUILD" | ||
|
||
# copy ccache dir within QGIS source so it can be accessed from docker | ||
cp -r ${CCACHE_DIR_IMAGE_BUILD} ${TRAVIS_BUILD_DIR}/.ccache_image_build | ||
# building docker images | ||
DIR=$(git rev-parse --show-toplevel)/.docker | ||
pushd "${DIR}" | ||
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}" | ||
docker build --build-arg DOCKER_TAG="${DOCKER_TAG}" \ | ||
--cache-from "qgis/qgis:${DOCKER_TAG}" \ | ||
-t "qgis/qgis:${DOCKER_TAG}" \ | ||
-f qgis.dockerfile .. | ||
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 as __DOCKER_TAG__", | ||
"config": { | ||
"merge_mode": "deep_merge", | ||
"matrix": { | ||
"include": { | ||
"env": ["QGIS_VERSION_BRANCH=__QGIS_VERSION_BRANCH__"] | ||
} | ||
} | ||
} | ||
} | ||
}' | ||
body=$(sed "s/__QGIS_VERSION_BRANCH__/${TRAVIS_BRANCH}/; s/__DOCKER_TAG__/${DOCKER_TAG}/" <<< $body) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,3 @@ | |
# # | ||
########################################################################### | ||
|
||
#pip3 install termcolor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "travis_fold:start:travis_env" | ||
echo "${bold}Travis environment variables${endbold}" | ||
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH" | ||
echo "TRAVIS_EVENT_TYPE: $TRAVIS_EVENT_TYPE" | ||
echo "DOCKER_TAG: $DOCKER_TAG" | ||
echo "TRAVIS_COMMIT_MESSAGE: $TRAVIS_COMMIT_MESSAGE" | ||
echo "DOCKER_DEPS_PUSH: $DOCKER_DEPS_PUSH" | ||
echo "DOCKER_BUILD_DEPS_FILE: $DOCKER_BUILD_DEPS_FILE" | ||
echo "TRAVIS_TIMESTAMP: $TRAVIS_TIMESTAMP" | ||
echo "travis_fold:end:travis_env" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters