summaryrefslogtreecommitdiffstats
path: root/scripts/osmocom-packages-docker.sh
blob: a7a804bf42bab8c8b32323af7b6b6cbedea8c9e8 (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
28
29
30
31
32
33
34
35
#!/bin/sh -ex
# Run osmocom-*-packages.sh in a docker container, so dependencies don't need
# to be installed on the host machine. See osmocom-nightly-packages.sh and
# osmocom-latest-packages.sh for supported environment variables.
SCRIPTS="$(realpath "$(dirname "$0")")"
IMAGE="debian10-obs-submit"
OSCRC="${OSCRC:-.oscrc}"

if ! [ -f "$OSCRC" ]; then
	echo "ERROR: missing OSCRC (should point to OSC credentials file)"
	exit 1
fi

. "$SCRIPTS/common.sh"
docker_images_require "$IMAGE"

case "$FEED" in
nightly|next|latest)
	SCRIPT="osmocom-$FEED-packages.sh"
	;;
*)
	# "2021q1" etc, osmocom-nightly-packages.sh verifies and uses $FEED
	SCRIPT="osmocom-nightly-packages.sh"
	;;
esac

docker run \
	-e "FEED=$FEED" \
	-e "OSMO_OBS_CONFLICT_PKGVER=$OSMO_OBS_CONFLICT_PKGVER" \
	-e "PACKAGES=$PACKAGES" \
	-e "PROJ=$PROJ" \
	-v "$SCRIPTS:/scripts" \
	-v "$(realpath "$OSCRC"):/home/user/.oscrc" \
	"$USER/$IMAGE" \
	sh -c "cd ~ && /scripts/$SCRIPT"