-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.sh
executable file
·68 lines (58 loc) · 1.32 KB
/
build.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#! /bin/sh
: ${PKG:=pkg}
ARCHES="amd64 aarch64"
BUILD=no
PUSH=no
build() {
local spec=$1; shift
local branch=$(echo $spec | cut -d: -f1)
local ver=$(echo $spec | cut -d: -f2)
for image in mtree static base minimal small; do
./build-${image}.sh -A "${ARCHES}" -b ${branch} ${ver} || exit 1
done
}
push() {
local spec=$1; shift
local branch=$(echo $spec | cut -d: -f1)
local ver=$(echo $spec | cut -d: -f2)
for image in mtree static base minimal small; do
./build-${image}.sh -A "${ARCHES}" -p ${branch} ${ver} || exit 1
done
}
while getopts "A:P:bp" arg; do
case ${arg} in
A)
ARCHES="${OPTARG}"
;;
P)
export PKG="${OPTARG}"
;;
b)
BUILD=yes
;;
p)
PUSH=yes
;;
*)
echo "Unknown argument"
esac
done
shift $((OPTIND-1))
# Packages for these branches are available on pkg.freebsd.org
builds="main:15 stable/14:14 releng/14.1:14.1"
# FreeBSD-13 builds are supported on my home lab infrastructure - hopefully
# these will also be added to pkg.freebsd.org soon.
if [ "${REPO_INSTALL_URL}" = "http://pkgbase.home.rabson.org" ]; then
builds="${builds} stable/13:13 releng/13.4:13.4"
fi
if [ $# -gt 0 ]; then
builds="$@"
fi
for i in ${builds}; do
if [ ${BUILD} = yes ]; then
build $i
fi
if [ ${PUSH} = yes ]; then
push $i
fi
done