mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-27 22:50:24 +01:00
Merge pull request #5265 from jeffhappily/update-docker-build
Update docker build
This commit is contained in:
commit
286bdeea57
@ -294,6 +294,8 @@ problems on nightly or LTS major, you need to fix build-constraints.yaml (see
|
|||||||
info above).
|
info above).
|
||||||
|
|
||||||
### Building LTS minor releases
|
### Building LTS minor releases
|
||||||
|
Before running the build, please make sure that the Dockerfile in `automated/dockerfiles/lts-X.Y` is up to date, where X is the major version that you're building and Y is the latest minor version of X for which a Dockerfile exists. If any changes need to be made, (eg, new GHC version), copy `lts-X.Y/Dockerfile` to `lts-X.Z/Dockerfile`, where Z is the minor version you're building, and include the new changes.
|
||||||
|
|
||||||
First run `build.sh` to regenerate updated `ltsXX/work/constraints.yaml` and `ltsXX/work/snapshot-incomplete.yaml` files.
|
First run `build.sh` to regenerate updated `ltsXX/work/constraints.yaml` and `ltsXX/work/snapshot-incomplete.yaml` files.
|
||||||
|
|
||||||
For an LTS minor bump, you'll typically want to:
|
For an LTS minor bump, you'll typically want to:
|
||||||
|
|||||||
@ -90,10 +90,36 @@ case "$LTS_SLUG_ARG" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine if lts slug is latest
|
||||||
|
#
|
||||||
|
|
||||||
|
SNAPSHOTS="$(mktemp "lts-snapshots.json.XXXXXX")"
|
||||||
|
trap "rm -f \"$SNAPSHOTS\"" EXIT
|
||||||
|
wget -qO- https://www.stackage.org/download/lts-snapshots.json >"$SNAPSHOTS"
|
||||||
|
|
||||||
LTS_VERSION="${LTS_SLUG#lts-}"
|
LTS_VERSION="${LTS_SLUG#lts-}"
|
||||||
LTS_MAJOR="${LTS_VERSION%.*}"
|
LTS_MAJOR="${LTS_VERSION%.*}"
|
||||||
LTS_MINOR="${LTS_VERSION#*.}"
|
LTS_MINOR="${LTS_VERSION#*.}"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine latest LTS version
|
||||||
|
#
|
||||||
|
|
||||||
|
LATEST_LTS_SLUG=$(jq -r ".[\"lts\"]" $SNAPSHOTS)
|
||||||
|
LATEST_LTS_VERSION="${LATEST_LTS_SLUG#lts-}"
|
||||||
|
LATEST_LTS_MAJOR="${LATEST_LTS_VERSION%.*}"
|
||||||
|
LATEST_LTS_MINOR="${LATEST_LTS_VERSION#*.}"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Determine latest minor version of the selected major version
|
||||||
|
#
|
||||||
|
|
||||||
|
MAJOR_LATEST_LTS_SLUG=$(jq -r ".[\"lts-$LTS_MAJOR\"]" $SNAPSHOTS)
|
||||||
|
MAJOR_LATEST_LTS_VERSION="${MAJOR_LATEST_LTS_SLUG#lts-}"
|
||||||
|
MAJOR_LATEST_LTS_MAJOR="${MAJOR_LATEST_LTS_VERSION%.*}"
|
||||||
|
MAJOR_LATEST_LTS_MINOR="${MAJOR_LATEST_LTS_VERSION#*.}"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Find the Dockerfile for the selected snapshot
|
# Find the Dockerfile for the selected snapshot
|
||||||
#
|
#
|
||||||
@ -128,9 +154,14 @@ fi
|
|||||||
# Create and push additional tags
|
# Create and push additional tags
|
||||||
#
|
#
|
||||||
|
|
||||||
# Create and push an 'lts-X' tag.
|
# If we select the latest minor version for the selected major version, then
|
||||||
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts-$LTS_MAJOR"
|
# also create and push an 'lts-X' tag.
|
||||||
|
if [[ $LTS_MINOR -ge $MAJOR_LATEST_LTS_MINOR ]]; then
|
||||||
|
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts-$LTS_MAJOR"
|
||||||
|
fi
|
||||||
|
|
||||||
# Create and push the 'lts' and 'latest' tags.
|
# If we selected the latest LTS snapshot, also create and push the 'lts' and 'latest' tags.
|
||||||
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts"
|
if [[ "$LTS_MAJOR" = "$LATEST_LTS_MAJOR" ]] && [[ $LTS_MINOR -ge $LATEST_LTS_MINOR ]]; then
|
||||||
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:latest"
|
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:lts"
|
||||||
|
tagpush "$DOCKER_REPO:$LTS_SLUG" "$DOCKER_REPO:latest"
|
||||||
|
fi
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user