aboutsummaryrefslogtreecommitdiffstats
path: root/main/aports-build
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-18 13:20:41 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-18 13:23:42 +0200
commitda111747964276b36ce33b517cef8b10c32e6e9f (patch)
treea37f0532f4f9675df0d4cdf7f2fba65d7b1fce2d /main/aports-build
parent0438899f40a46b3b5061824411d63ce82a980cc5 (diff)
downloadaports-da111747964276b36ce33b517cef8b10c32e6e9f.tar.bz2
aports-da111747964276b36ce33b517cef8b10c32e6e9f.tar.xz
main/aports-build: upload each repo when built
we dont want prevent to upload a successful built main repo if testing fails to build.
Diffstat (limited to 'main/aports-build')
-rw-r--r--main/aports-build/APKBUILD8
-rw-r--r--main/aports-build/aports-build49
2 files changed, 28 insertions, 29 deletions
diff --git a/main/aports-build/APKBUILD b/main/aports-build/APKBUILD
index aabc72e9c0..28224cb882 100644
--- a/main/aports-build/APKBUILD
+++ b/main/aports-build/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=aports-build
pkgver=0.9
-pkgrel=2
+pkgrel=3
pkgdesc="MQTT based build-on-git-push scripts for Alpine Linux"
url="http://alpinelinux.org"
arch="noarch"
@@ -44,12 +44,12 @@ package() {
}
-md5sums="47ab3e00e8efd9a6fb93ce1b29e62830 aports-build
+md5sums="c9a0030398b4fd76c9517e607673d747 aports-build
cb4807ea64c4368487786217db087bac aports-build.initd
c02d90b2bb0c48e416b707caa8766c50 mqtt-exec.aports-build.confd"
-sha256sums="eb5345f20450c9c38f7b39dbd2c62f2d32e58b1605778cc9c014b3acce695dc3 aports-build
+sha256sums="ac96ed107e88319a7d45425df8c4c0458bc488b1ef19a42431dee246fcabc9f2 aports-build
3e2d551f72273f37290db342a153abd377397483677a684645d22df7b8a8592f aports-build.initd
7d2001688c3776ffb53c422dee424bcf0346ae20f3df5c6c2f4944022b19cb4d mqtt-exec.aports-build.confd"
-sha512sums="9ad63905762c0d708e7714b5af03c87605968149e7305ef800ea0e697f83c486d3ab8f0d801e2426119c18c9c98075e6cc923ce0d45239805cd10d5251c4108d aports-build
+sha512sums="b1455606baff233061e5dba218062966ab636e104e31eb523da6487f0bd7207ab8e2a418225e02996715d938a89e71168e768d7cf1fb1458e70e131c78e31630 aports-build
821035bda47152c341ec94bf960fa67e3377051826712ceb74f39103e6e422777b6e082231bfb87865653d2b93b7d3154cfc24abf65a52e3e66da69412dd7e41 aports-build.initd
93d26e2055dbb02e863bf76b64a549c100decec3fda612ce96ca1464e6d61befa9f57f202553a25cf323e67e266f532d19c7423ff070943a59b3973946d949fe mqtt-exec.aports-build.confd"
diff --git a/main/aports-build/aports-build b/main/aports-build/aports-build
index 8bc1befd60..c5d33a09d1 100644
--- a/main/aports-build/aports-build
+++ b/main/aports-build/aports-build
@@ -89,7 +89,7 @@ new_release() {
}
build() {
- ( $buildrepo $repos || echo "FAIL" ) | while read line; do
+ ( $buildrepo "$@" || echo "FAIL" ) | while read line; do
case "$line" in
FAIL) return 1;;
[0-9]*/[0-9]*) $status_msg "$line";;
@@ -145,28 +145,28 @@ while true; do
# do the compile, send output to log
log "building $_current"
- if ! build >"$logdir"/$hostname.log 2>&1 ; then
- local errlog=$hostname.$_current.log
- cp "$logdir"/$hostname.log "$logdir"/$errlog
- # todo: revert last commit?
- send_irc "failed to build $_current: $logurlprefix/$errlog"
- exit 1
- fi
+ rc=0
+ for repo in $repos; do
+ if ! build $repo >"$logdir"/$hostname.log 2>&1 ; then
+ local errlog=$hostname.$_current.log
+ cp "$logdir"/$hostname.log "$logdir"/$errlog
+ # todo: revert last commit?
+ send_irc "failed to build $_current: $logurlprefix/$errlog"
+ exit 1
+ fi
- # upgrade our running system
- log "upgrading system"
- sudo apk upgrade -U -a --quiet || log 'failed to apk upgrade'
+ # upgrade our running system
+ log "upgrading system"
+ sudo apk upgrade -U -a --quiet || log 'failed to apk upgrade'
- # copy for distribution
- cd "$packages" || return 1
- if [ -z "$upload_pkg" ]; then
- break
- fi
- log "uploading packages"
- rc=0
- for i in $upload_pkg; do
- local repo
- for repo in $repos; do
+ # copy for distribution
+ cd "$packages" || return 1
+ if [ -z "$upload_pkg" ]; then
+ continue
+ fi
+
+ log "uploading packages to $repo"
+ for i in $upload_pkg; do
if rsync -ruv --delete-delay --delay-updates \
$repo/$arch $i/$repo/; then
$upload_msg "$rel/$repo/$arch"
@@ -174,13 +174,12 @@ while true; do
rc=1
fi
done
+ # report to irc that we are done with repo
+ send_irc "files from $_current uploaded to $repo"
done
[ $rc -eq 0 ] && touch /tmp/uploaded && sudo apk update
- # report to irc that we are done
- send_irc "files from $_current uploaded"
-
- if $do_release; then
+ if [ -n "$upload_pkg" ] && $do_release; then
if new_release ${_current_tag#v}; then
$upload_msg "$rel/releases/$arch"
send_irc "release $_current_tag uploaded"