get build system from before
This commit is contained in:
parent
9a01f02a08
commit
408bce4abe
1 changed files with 57 additions and 17 deletions
|
@ -1,7 +1,7 @@
|
||||||
diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh
|
diff --git a/usr/local/bin/build.sh.orig b/usr/local/bin/build.sh
|
||||||
old mode 100644
|
old mode 100644
|
||||||
new mode 100755
|
new mode 100755
|
||||||
index c3b8f7a..d799817
|
index c3b8f7a..b3c222e
|
||||||
--- a/usr/local/bin/build.sh.orig
|
--- a/usr/local/bin/build.sh.orig
|
||||||
+++ b/usr/local/bin/build.sh
|
+++ b/usr/local/bin/build.sh
|
||||||
@@ -7,13 +7,14 @@
|
@@ -7,13 +7,14 @@
|
||||||
|
@ -9,7 +9,7 @@ index c3b8f7a..d799817
|
||||||
|
|
||||||
readonly APORTSDIR=$CI_PROJECT_DIR
|
readonly APORTSDIR=$CI_PROJECT_DIR
|
||||||
-readonly REPOS="main community testing non-free"
|
-readonly REPOS="main community testing non-free"
|
||||||
+readonly ALPINE_REPOS="main community testing"
|
+readonly REPOS="main community testing"
|
||||||
readonly ARCH=$(apk --print-arch)
|
readonly ARCH=$(apk --print-arch)
|
||||||
# gitlab variables
|
# gitlab variables
|
||||||
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
readonly BASEBRANCH=$CI_MERGE_REQUEST_TARGET_BRANCH_NAME
|
||||||
|
@ -21,7 +21,7 @@ index c3b8f7a..d799817
|
||||||
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
|
: "${MAX_ARTIFACT_SIZE:=300000000}" #300M
|
||||||
: "${CI_DEBUG_BUILD:=}"
|
: "${CI_DEBUG_BUILD:=}"
|
||||||
|
|
||||||
@@ -67,13 +68,24 @@ report() {
|
@@ -67,10 +68,14 @@ report() {
|
||||||
}
|
}
|
||||||
|
|
||||||
get_release() {
|
get_release() {
|
||||||
|
@ -39,19 +39,12 @@ index c3b8f7a..d799817
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
+readonly REPOS="qubes-$(get_qubes_release)"
|
@@ -99,13 +104,13 @@ set_repositories_for() {
|
||||||
+
|
local release
|
||||||
+# hack to support at-root packages
|
|
||||||
+changed_repos() {
|
|
||||||
+ echo "."
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
build_aport() {
|
|
||||||
local repo="$1" aport="$2"
|
|
||||||
cd "$APORTSDIR/$repo/$aport"
|
|
||||||
@@ -101,11 +113,11 @@ set_repositories_for() {
|
|
||||||
release=$(get_release)
|
release=$(get_release)
|
||||||
for repo in $REPOS; do
|
- for repo in $REPOS; do
|
||||||
|
+ for repo in qubes-$(get_qubes_release); do
|
||||||
[ "$repo" = "non-free" ] && continue
|
[ "$repo" = "non-free" ] && continue
|
||||||
- [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
|
- [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
|
||||||
+ [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue
|
+ [ "$release" == "edge" ] && [ "$repo" == "backports" ] && continue
|
||||||
|
@ -63,7 +56,7 @@ index c3b8f7a..d799817
|
||||||
doas apk update
|
doas apk update
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +130,15 @@ apply_offset_limit() {
|
@@ -118,7 +123,15 @@ apply_offset_limit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_system() {
|
setup_system() {
|
||||||
|
@ -72,7 +65,7 @@ index c3b8f7a..d799817
|
||||||
+ local release
|
+ local release
|
||||||
+
|
+
|
||||||
+ release=$(get_release)
|
+ release=$(get_release)
|
||||||
+ for repo in $ALPINE_REPOS; do
|
+ for repo in $REPOS; do
|
||||||
+ [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
|
+ [ "$release" != "edge" ] && [ "$repo" == "testing" ] && continue
|
||||||
+ repos="$repos $ALPINE_MIRROR/$release/$repo"
|
+ repos="$repos $ALPINE_MIRROR/$release/$repo"
|
||||||
+ done
|
+ done
|
||||||
|
@ -80,3 +73,50 @@ index c3b8f7a..d799817
|
||||||
doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system"
|
doas apk -U upgrade -a || apk fix || die "Failed to up/downgrade system"
|
||||||
abuild-keygen -ain
|
abuild-keygen -ain
|
||||||
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf
|
doas sed -i -E 's/export JOBS=[0-9]+$/export JOBS=$(nproc)/' /etc/abuild.conf
|
||||||
|
@@ -192,32 +205,22 @@ section_end setup
|
||||||
|
build_start=$CI_ALPINE_BUILD_OFFSET
|
||||||
|
build_limit=$CI_ALPINE_BUILD_LIMIT
|
||||||
|
|
||||||
|
-for repo in $(changed_repos); do
|
||||||
|
- set_repositories_for "$repo"
|
||||||
|
- built_aports=0
|
||||||
|
- changed_aports_in_repo=$(changed_aports "$repo")
|
||||||
|
- changed_aports_in_repo_count=$(echo "$changed_aports_in_repo" | wc -l)
|
||||||
|
- changed_aports_to_build=$(echo "$changed_aports_in_repo" | apply_offset_limit "$build_start" "$build_limit")
|
||||||
|
+set_repositories_for $(get_qubes_release)
|
||||||
|
+built_aports=0
|
||||||
|
+changed_aports_in_repo=$(changed_aports $BASEBRANCH)
|
||||||
|
+changed_aports_in_repo_count=$(echo "$changed_aports_in_repo" | wc -l)
|
||||||
|
+changed_aports_to_build=$(echo "$changed_aports_in_repo" | apply_offset_limit "$build_start" "$build_limit")
|
||||||
|
|
||||||
|
- msg "Changed aports in $repo:"
|
||||||
|
- # shellcheck disable=SC2086 # Splitting is expected here
|
||||||
|
- printf " - %s\n" $changed_aports_to_build
|
||||||
|
- for pkgname in $changed_aports_to_build; do
|
||||||
|
- section_start "build_$pkgname" "Building package $pkgname"
|
||||||
|
- built_aports=$((built_aports+1))
|
||||||
|
- if check_aport "$repo" "$pkgname"; then
|
||||||
|
- build_aport "$repo" "$pkgname"
|
||||||
|
- fi
|
||||||
|
- section_end "build_$pkgname"
|
||||||
|
- done
|
||||||
|
-
|
||||||
|
- build_start=$((build_start-(changed_aports_in_repo_count-built_aports)))
|
||||||
|
- build_limit=$((build_limit-built_aports))
|
||||||
|
-
|
||||||
|
- if [ $build_limit -le 0 ]; then
|
||||||
|
- msg "Limit reached, breaking"
|
||||||
|
- break
|
||||||
|
+msg "Changed aports:"
|
||||||
|
+# shellcheck disable=SC2086 # Splitting is expected here
|
||||||
|
+printf " - %s\n" $changed_aports_to_build
|
||||||
|
+for pkgname in $changed_aports_to_build; do
|
||||||
|
+ section_start "build_$pkgname" "Building package $pkgname"
|
||||||
|
+ built_aports=$((built_aports+1))
|
||||||
|
+ if check_aport qubes-aports "$pkgname"; then
|
||||||
|
+ build_aport qubes-aports "$pkgname"
|
||||||
|
fi
|
||||||
|
+ section_end "build_$pkgname"
|
||||||
|
done
|
||||||
|
|
||||||
|
section_start artifacts "Handeling artifacts" collapse
|
||||||
|
|
Loading…
Reference in a new issue