Repository navigation
Expand file tree
/
Copy pathgithub-build.sh
More file actions
executable file
·57 lines (44 loc) · 1.69 KB
/
Copy pathgithub-build.sh
File metadata and controls
executable file
·57 lines (44 loc) · 1.69 KB
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
#!/bin/sh
set -e
: "${PACKAGER_PRIVKEY:=$PWD/../.abuild/privkey.rsa}"
: "${APORTS_DIR:=$PWD}"
: "${PACKAGES_DIR:=$PWD/../packages}"
die() {
echo >&2 "Error: $1"
exit 1
}
echo "ALPINE_VERSION=$ALPINE_VERSION"
echo "PACKAGER_PRIVKEY=$PACKAGER_PRIVKEY"
echo "APORTS_DIR=$APORTS_DIR"
echo "PACKAGES_DIR=$PACKAGES_DIR"
[ -n "$ALPINE_VERSION" ] || die "ALPINE_VERSION not set"
[ -f "$PACKAGER_PRIVKEY" ] || die "PACKAGER_PRIVKEY not found"
[ -f "$PACKAGER_PRIVKEY.pub" ] || die "PACKAGER_PRIVKEY.pub not found"
[ -d "$APORTS_DIR" ] || die "APORTS_DIR not found"
[ -d "$PACKAGES_DIR" ] || die "PACKAGES_DIR not found"
[ ! -d "$PACKAGES_DIR/$ALPINE_VERSION" ] && mkdir "$PACKAGES_DIR/$ALPINE_VERSION"
packager_privkey_basename=$(basename "$PACKAGER_PRIVKEY")
script_dir=$(dirname "$0")
docker build \
-t aports-builder \
--build-arg="ALPINE_VERSION=$ALPINE_VERSION" \
--build-arg="ABUILD_UID=$(id -u)" \
--build-arg="PACKAGER_PRIVKEY_BASENAME=$packager_privkey_basename" \
-f "$script_dir/github-build.Dockerfile" \
"$script_dir"
for repo in $*; do
echo "Building packages in: $repo"
docker run \
--rm \
--privileged \
--volume "$PACKAGER_PRIVKEY:/abuild/.abuild/$packager_privkey_basename" \
--volume "$PACKAGER_PRIVKEY.pub:/abuild/.abuild/$packager_privkey_basename.pub" \
--volume "$PACKAGER_PRIVKEY.pub:/etc/apk/keys/$packager_privkey_basename.pub" \
--volume "$APORTS_DIR:/abuild/aports" \
--volume "$PACKAGES_DIR/$ALPINE_VERSION:/abuild/packages" \
--env "ALPINE_VERSION=$ALPINE_VERSION" \
aports-builder buildrepo \
-a /abuild/aports \
-d /abuild/packages \
-p -R $repo
done