aboutsummaryrefslogtreecommitdiff
path: root/bin/build
diff options
context:
space:
mode:
Diffstat (limited to 'bin/build')
-rwxr-xr-xbin/build27
1 files changed, 27 insertions, 0 deletions
diff --git a/bin/build b/bin/build
new file mode 100755
index 0000000..63cfe97
--- /dev/null
+++ b/bin/build
@@ -0,0 +1,27 @@
+#!/bin/sh
+# SPDX-License-Identifier: 0BSD
+
+set -eu
+
+img=${1?"usage: $0 <image>"}
+
+test -f git-annex/git-annex.cabal || {
+ printf >&2 'initialize git-annex submodule first\n'
+ exit 1
+}
+test -z "$(git -C git-annex status --porcelain -unormal)" || {
+ printf >&2 'git-annex repository is dirty\n'
+ exit 1
+}
+test -n "$(git -C git-annex for-each-ref --points-at=HEAD refs/tags)" || {
+ printf >&2 'git-annex repository must be on a tagged commit\n'
+ exit 1
+}
+
+git -C git-annex clean -xfd
+podman run \
+ -v ./git-annex:/git-annex \
+ -v ./img-scripts:/mnt \
+ -w /git-annex \
+ --env RELEASE_BUILD=1 --rm \
+ "$img" /mnt/build