Default to using the current commit, instead of latest

This is generally what you want, and will behave better than using latest.
pull/140/head
Mike Lang 5 years ago
parent 731ef9e2d0
commit 751472217b

@ -2,6 +2,9 @@
set -eu
# cd to location of script
cd "$(dirname "$(readlink -f "$0")")"
# Builds the docker images.
# Usage: ./build {COMPONENTS}, or just ./build to build all.
# The resulting images are named wubloader-COMPONENT.
@ -17,10 +20,7 @@ PUSH=${PUSH:-}
BASE="quay.io/ekimekim"
# The docker image tag, derived from the git commit + whether working tree is clean
TAG=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
TAG="$TAG-wip"
fi
TAG=$(./get-build-tag)
if [ "$#" -gt 0 ]; then
COMPONENTS=("$@")

@ -7,9 +7,11 @@
// Change these to configure the services.
// Image tag (application version) to use.
// By default, will use the current commit, ie. the same thing that ./build would tag
// things it builds with.
// Note: "latest" is not recommended in production, as you can't be sure what version
// you're actually running, and must manually re-pull to get an updated copy.
image_tag:: "latest",
image_tag:: std.extVar("tag"),
// For each service, whether to deploy that service.
enabled:: {

@ -2,9 +2,12 @@
set -eu
# cd to location of script
cd "$(dirname "$(readlink -f "$0")")"
# We generate first, and capture the output, to avoid overwriting the file on error.
# To avoid jsonnet needing to exist locally, we run it in a container.
output=$(docker run --rm -i sparkprime/jsonnet - < docker-compose.jsonnet)
output=$(docker run --rm -i sparkprime/jsonnet -V tag="$(./get-build-tag)" - < docker-compose.jsonnet)
{
echo "# DO NOT EDIT THIS FILE!"

@ -0,0 +1,11 @@
#!/bin/bash
# cd to location of script
cd "$(dirname "$(readlink -f "$0")")"
TAG=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
TAG="$TAG-wip"
fi
echo "$TAG"
Loading…
Cancel
Save