Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Allow CI to run on old branches
Browse files Browse the repository at this point in the history
by building from the latest tag present on this branch instead of building from
develop.
  • Loading branch information
saraedum committed Oct 12, 2018
1 parent 90e1749 commit 28c48df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .ci/build-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ set -ex

# We speed up the build process by copying built artifacts from ARTIFACT_BASE
# during docker build. See /docker/Dockerfile for more details.
ARTIFACT_BASE=${ARTIFACT_BASE:-sagemath/sagemath-dev:develop}
ARTIFACT_BASE=${ARTIFACT_BASE:-sagemath/sagemath-dev:`git describe --abbrev=0 --tags`}

# Seed our cache with $ARTIFACT_BASE if it exists.
docker pull "$ARTIFACT_BASE" > /dev/null || true
if ! (docker pull "$ARTIFACT_BASE" > /dev/null); then
# If this image does not exist, fall back to sagemath-dev:develop (this might happen when the latest tag has not been built yet.)
ARTIFACT_BASE=${ARTIFACT_BASE:-sagemath/sagemath-dev:develop}
docker pull "$ARTIFACT_BASE" > /dev/null || true;
fi

docker_build() {
# Docker's --cache-from does not really work with multi-stage builds: https://github.com/moby/moby/issues/34715
Expand Down

0 comments on commit 28c48df

Please sign in to comment.