-
Notifications
You must be signed in to change notification settings - Fork 15
/
build-selfhosted.sh
executable file
·48 lines (47 loc) · 1.13 KB
/
build-selfhosted.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
usage() {
echo "Usage: build-standalone.sh [flags] [ubuntu|almalinux]"
echo
echo "Where flags:"
echo "-b [docker|podman] Image build tool to use - defaults to which it finds first"
echo "-h Display this usage information"
echo
echo "If no distribution is specified then images for both are built"
exit
}
ARCH=`uname -m`
DISTROS=""
BUILDER=`which podman 2>/dev/null`
if [ -z ${BUILDER} ]; then
BUILDER=`which docker 2>/dev/null`
fi
if [ -z ${BUILDER} ]; then
echo "Need podman or docker installed" >&2
exit 1
fi
while getopts "b:h:" opt
do
case "${opt}" in
b)
BUILDER="${OPTARG}"
;;
h)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
if [ -z "$@" ]; then
DISTROS="ubuntu almalinux"
else
DISTROS=$@
fi
for dist in ${DISTROS}
do
if [ ! -f Dockerfile.${dist} ]; then
echo "${dist} not supported" >&2
else
${BUILDER} build -f Dockerfile.${dist} --build-arg RUNNERPATCH=build-files/runner-sdk-8.patch \
--build-arg ARCH=${ARCH} --tag runner:${dist} .
fi
done