check / check (push) Failing after 56s
script/build writes the version script/version prints into dist/package.json, which quak --version reports: the VERSION environment variable or build arg when one is given, otherwise git describe --tags --always, otherwise package.json's version. A checkout with .git whose version comes out empty, dev or unknown fails the build. .dockerignore no longer leaves out .git, and ARG VERSION has no default, so a plain docker build . of a clone stamps its commit. script/docker and script/cibuild still pass the host's version. make build-bin bundles the built dist/, so the single binary reports the same version. Model: opus-5-5
29 lines
1.1 KiB
Bash
Executable File
29 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# script/cibuild: run the CI build. The image's last stage depends on the
|
|
# lint and test phases, so this one build runs eslint, prettier and the
|
|
# suite once each and then compiles. Unlike the template it does not run
|
|
# script/check first, which would run lint and the tests a second time.
|
|
# --no-cache for the same reason as script/docker: the gate phases the
|
|
# final stage depends on are RUN steps, and a cached one is a check that
|
|
# did not run.
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
# Own line: a failing command substitution inside an argument does
|
|
# not trip `set -e`, so the inline form degrades silently to an
|
|
# empty constant. The version resolved here goes in as the VERSION
|
|
# build arg, which takes precedence over what the build would derive
|
|
# from the .git in its context.
|
|
version="$(git describe --tags --always --dirty 2>/dev/null || true)"
|
|
[ -n "$version" ] || version="unknown"
|
|
docker build --no-cache \
|
|
--build-arg VERSION="$version" \
|
|
-t "$("$SCRIPT_DIR/projectname")" .
|
|
}
|
|
|
|
main "$@"
|