Skip to content
Permalink
Browse files

[docker] create images for final releases (#6594)

* [docker] create images for final releases

based on git tags

* fix script
  • Loading branch information
3nids committed Mar 13, 2018
1 parent 88e8acd commit 914e7bbe893e707e9b0f9e40f7c171fd567c1ccb
Showing with 27 additions and 7 deletions.
  1. +11 −1 .ci/travis/linux/before_script.sh
  2. +3 −1 .ci/travis/linux/script.sh
  3. +12 −0 .ci/travis/scripts/travis_envvar_helper.sh
  4. +1 −5 .travis.yml
@@ -17,6 +17,16 @@ set -e

pushd .docker

source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.sh


DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo "true" || echo "false" )
DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ '[docker] update dependencies' ]] && echo "true" || echo "false" )
# on cron job, QGIS image is built and push without testing
DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image
QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds


echo "travis_fold:start:travis_env"
echo "${bold}${endbold}"
echo "TRAVIS_BRANCH: $TRAVIS_BRANCH"
@@ -33,7 +43,7 @@ echo "travis_fold:end:travis_env"
echo "travis_fold:start:docker_build"
echo "${bold}Docker build deps${endbold}"
docker --version
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ false ]]; then
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 0 ]]; then
docker-compose --version
docker-compose -f $DOCKER_COMPOSE config
fi
@@ -15,11 +15,13 @@

set -e

source $(git rev-parse --show-toplevel)/.ci/travis/scripts/travis_envvar_helper.sh

DOCKER_QGIS_IMAGE_BUILD_PUSH=create_qgis_image

mkdir -p $CCACHE_DIR

if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH =~ true ]]; then
if [[ $DOCKER_QGIS_IMAGE_BUILD_PUSH -eq 1 ]]; then
DIR=$(git rev-parse --show-toplevel)/.docker
pushd ${DIR}
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

function create_qgis_image {

if [[ ! $TRAVIS_REPO_SLUG =~ qgis/QGIS ]]; then
return 0
fi
if [[ $TRAVIS_EVENT_TYPE =~ cron ]] || [[ -n $TRAVIS_TAG ]]; then
return 1;
fi
return 0;
}
@@ -8,12 +8,8 @@ matrix:
env:
- TRAVIS_CONFIG=linux
- DOCKER_COMPOSE=${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml
# TRAVIS_BRANCH is either the git tag or the branch name when no tag
- DOCKER_TAG=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && echo $TRAVIS_BRANCH | sed 's/master/latest/' || echo "latest" )
- DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ push ]] && echo "true" || echo "false" )
- DOCKER_DEPS_IMAGE_REBUILD=$( [[ $TRAVIS_COMMIT_MESSAGE =~ '[docker] update dependencies' ]] && echo "true" || echo "false" )
# on cron job, QGIS image is built and push without testing
- DOCKER_QGIS_IMAGE_BUILD_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ $TRAVIS_EVENT_TYPE =~ cron ]] && echo "true" || echo "false" )
- QGIS_LAST_BUILD_SUCCESS=true # TODO use API to know if last build succeed https://developer.travis-ci.com/resource/builds
- TRAVIS_TIMESTAMP=$(date +%s)
- CCACHE_DIR=${HOME}/.ccache
dist: trusty

0 comments on commit 914e7bb

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