check / check (push) Waiting to run
A plain docker build, as upaas runs it, passed no VERSION build arg and had no .git, so every such image stamped "unknown". .dockerignore now sends .git and every tracked file (an excluded one would read as deleted and mark the version -dirty), and the VERSION build arg loses its "unknown" default, so script/version derives the version inside the build. A VERSION build arg still takes precedence. The builder stage installs git and fails when its context carries .git and the version still comes out "unknown". Model: opus-5-5
21 lines
544 B
Bash
Executable File
21 lines
544 B
Bash
Executable File
#!/bin/sh
|
|
# script/docker: build the Docker image tagged with the project name.
|
|
# The tag comes from script/projectname.
|
|
#
|
|
# The version script/version resolves here goes in as the VERSION build
|
|
# arg, which takes precedence over what the build would derive from the
|
|
# .git in its context.
|
|
set -eu
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
|
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
|
|
|
main() {
|
|
cd "$ROOT"
|
|
docker build \
|
|
--build-arg VERSION="$("$SCRIPT_DIR/version")" \
|
|
-t "$("$SCRIPT_DIR/projectname")" .
|
|
}
|
|
|
|
main "$@"
|