summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2017-09-27 14:58:56 +0300
committerTimo Teräs <timo.teras@iki.fi>2017-09-27 14:58:56 +0300
commit545eed3a242c86566ce7a7ebd0f9f1e296eecbeb (patch)
treeecf1d34cb5ce9cdbd2a43c6f201f780709b5ff5a
parent4736a56c8e6ffee2f9101ab8d2b814eb239f5889 (diff)
downloadabuild-545eed3a242c86566ce7a7ebd0f9f1e296eecbeb.tar.gz
abuild-545eed3a242c86566ce7a7ebd0f9f1e296eecbeb.tar.bz2
abuild-545eed3a242c86566ce7a7ebd0f9f1e296eecbeb.tar.xz
abuild-545eed3a242c86566ce7a7ebd0f9f1e296eecbeb.zip
abuild: rootbld: reflect build branch in the builder hostname
-rw-r--r--abuild.in16
1 files changed, 7 insertions, 9 deletions
diff --git a/abuild.in b/abuild.in
index ef80891..4d68d9a 100644
--- a/abuild.in
+++ b/abuild.in
@@ -2078,6 +2078,12 @@ rootbld() {
cp /etc/abuild.conf /etc/group /etc/passwd "$BUILD_ROOT/etc"
cp /etc/apk/keys/* "$BUILD_ROOT/etc/apk/keys"
+ local version="edge" buildhost="edge" gitref
+ if gitref="$(expr "$(git symbolic-ref --short HEAD)" : '\([0-9]\+\(\.[0-9]\+\)*\)-')"; then
+ version=v${gitref}
+ buildhost=${gitref/./-}
+ fi
+
local repo_template=$aportsgit/$repo/.rootbld-repositories
[ -s "$repo_template" ] || die "rootbld: $repo_template does not exist"
(
@@ -2090,14 +2096,6 @@ rootbld() {
export mirror version
[ "$mirror" ] || mirror=http://dl-cdn.alpinelinux.org/alpine
- if [ -z "$version" ]; then
- version=$(git symbolic-ref --short HEAD)
- [ "$version" ] && \
- version=$(expr "$version" : '\([0-9]\+\(\.[0-9]\+\)*\)-') && \
- version=v${version}
- [ "$version" ] || version=edge
- fi
-
envsubst
echo "$REPODEST/$repo"
) < "$repo_template" > "$BUILD_ROOT/etc/apk/repositories"
@@ -2119,7 +2117,7 @@ rootbld() {
--bind "$BUILD_ROOT/tmp/pkg" "$pkgbasedir" \
--bind "$BUILD_ROOT/tmp" /tmp \
--bind "$REPODEST" "$REPODEST" \
- --hostname "build-edge-$CARCH" \
+ --hostname "build-$buildhost-$CARCH" \
--chdir "$startdir" \
--setenv PATH /bin:/usr/bin:/sbin:/usr/sbin \
/usr/bin/abuild $force rootbld_actions