aboutsummaryrefslogtreecommitdiff
path: root/bin/build
blob: 63cfe97b0720710a4eccf2c040d54a33e43a3130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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