aboutsummaryrefslogtreecommitdiffstats
path: root/main/aports-build
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-11-11 15:52:54 -0800
committerNatanael Copa <ncopa@alpinelinux.org>2016-11-14 20:10:40 +0000
commit3d0a98ac010b179eb69fbd16507ff56be19c575c (patch)
tree409e615b26857b4e8576e5442c17cb5287cbe8a6 /main/aports-build
parent08694394995e558de5d3331cf88d338735916779 (diff)
downloadaports-3d0a98ac010b179eb69fbd16507ff56be19c575c.tar.bz2
aports-3d0a98ac010b179eb69fbd16507ff56be19c575c.tar.xz
main/aports-build: use mkimage shipped with aports
this replaces abuild-iso also add options to skip do the full build and to force generation of release images. This helps when debugging the script.
Diffstat (limited to 'main/aports-build')
-rw-r--r--main/aports-build/APKBUILD10
-rw-r--r--main/aports-build/aports-build74
2 files changed, 43 insertions, 41 deletions
diff --git a/main/aports-build/APKBUILD b/main/aports-build/APKBUILD
index bf550e7e31..d2100f20e9 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=1.0
-pkgrel=9
+pkgver=1.1
+pkgrel=0
pkgdesc="MQTT based build-on-git-push scripts for Alpine Linux"
url="http://alpinelinux.org"
arch="noarch"
@@ -49,15 +49,15 @@ package() {
|| return 1
}
-md5sums="3b6d3dafbd970bb4b6a7c781895d40b6 aports-build
+md5sums="fff27cb689beab2922c9b71635ca694d aports-build
cb4807ea64c4368487786217db087bac aports-build.initd
c02d90b2bb0c48e416b707caa8766c50 mqtt-exec.aports-build.confd
ea60ae81dc6557b0312f181c8c8aeecf report-build-errors.lua"
-sha256sums="44aba1c40ccd0afec6c5ebe5f6409b583523f6faceb18d0aed7df7edc1cdddf8 aports-build
+sha256sums="0e8bc6c62940f9bf705596262d328850a7134115220fda8eef9ca957941a7420 aports-build
3e2d551f72273f37290db342a153abd377397483677a684645d22df7b8a8592f aports-build.initd
7d2001688c3776ffb53c422dee424bcf0346ae20f3df5c6c2f4944022b19cb4d mqtt-exec.aports-build.confd
b3d083ed4609ec92630819b638cd5dafdad17df68b25aa6da4c70de901910448 report-build-errors.lua"
-sha512sums="70f88f8eeee743e3e954b5ad05855080b1d8367abe50b9e6d4de25fb5f2b6c2f781285861570c16b2c56e0603eeb76a5f3fb77d1e0353c9e6bc34ac4c89bfcf4 aports-build
+sha512sums="885f33bad12e33570f8cd206b0e37e6087576073d7ac46951167318a72fa8facf4ecdebae3cb1ef3dce67c2d69285de39ac864e315faaf881b5d923468fa439f aports-build
821035bda47152c341ec94bf960fa67e3377051826712ceb74f39103e6e422777b6e082231bfb87865653d2b93b7d3154cfc24abf65a52e3e66da69412dd7e41 aports-build.initd
93d26e2055dbb02e863bf76b64a549c100decec3fda612ce96ca1464e6d61befa9f57f202553a25cf323e67e266f532d19c7423ff070943a59b3973946d949fe mqtt-exec.aports-build.confd
3453e45cb687d2af6cd1c490fd5b7134f643570a84b354b57ba49295e5a0d01ef65abc0909aeb424cbe48aa280c19cc4f1dce5f4f10e5137a80395c3be00c733 report-build-errors.lua"
diff --git a/main/aports-build/aports-build b/main/aports-build/aports-build
index 9a652418dc..9982cb7a09 100644
--- a/main/aports-build/aports-build
+++ b/main/aports-build/aports-build
@@ -34,6 +34,7 @@ arch=$(abuild -A)
aports=${APORTS:-$HOME/aports}
isodir=$HOME/alpine-iso
packages=${REPOSDIR:-$HOME/packages}
+releasedir="$packages/releases/$arch"
repos=${REPOS:-"main community testing"}
: ${buildrepo:="buildrepo -p"}
@@ -62,34 +63,22 @@ send_irc() {
}
# create new_release
-new_release() {
- local new=$1
- local target="all-release"
- local yaml=latest-releases.yaml
- local txt=.latest.txt
- local release_pkgs="lua"
- if [ "$rel" = "edge" ]; then
- target="edge"
- fi
+create_release() {
+ local release="$1"
+ local release_deps="abuild apk-tools alpine-conf busybox fakeroot xorriso rsync"
case "$arch" in
- x86*) release_pkgs="$release_pkgs syslinux";;
+ x86*) release_deps="$release_deps syslinux";;
esac
- cd "$isodir"
- echo "$new" > current
- rm -rf isotmp.*
- sudo apk add --virtual .alpine-release $release_pkgs
- if ! make $target; then
- rm current
- return 1
+
+ cd "$aports"
+ abuild-apk add --virtual .alpine-release-deps $release_deps
+ sh scripts/mkimage.sh --repository $packages/main --yaml \
+ --tag "$release" --outdir $releasedir || return 1
+
+ if $use_network; then
+ ssh $upload_host mkdir -p "${upload_iso#${upload_host}:}"
+ rsync -ruv "$releasedir"/* "$upload_iso" || return 1
fi
- sh mklatest.sh || return 1
- ssh $upload_host mkdir -p "${upload_iso#${upload_host}:}"
- [ -e "$yaml" ] || yaml=""
- [ -e "$txt" ] || txt=""
- rsync -ruv $yaml $txt *"$new"* "$upload_iso" || return 1
- sudo apk del .alpine-release
- mv current previous
- return 0
}
build() {
@@ -105,11 +94,22 @@ build() {
cd $aports || return 1
[ -z "$repos" ] && return 1
+use_network=true
+force_release=false
+skip_build=false
+
# parse opts
-while getopts "fu:" opt; do
+while getopts "fFu:ns" opt; do
case $opt in
'f') force=true;;
+ 'F') force_release=true;;
'u') logurl=" $OPTARG";;
+ 'n') use_network=false
+ status_msg="echo status_msg:"
+ upload_msg="echo upload_msg:"
+ irc_msg="echo irc_msg:"
+ ;;
+ 's') skip_build=true;;
esac
done
shift $(( $OPTIND - 1 ))
@@ -118,11 +118,13 @@ while true; do
do_release=false
cd $aports || return 1
# check if we need to rebuild
- log "pulling git"
_old=$(git describe)
_old_tag=$(git describe --abbrev=0)
- git checkout $git_branch
- git pull || return 1
+ if $use_network; then
+ log "pulling git"
+ git checkout $git_branch
+ git pull || return 1
+ fi
_current=$(git describe)
_current_tag=$(git describe --abbrev=0)
if [ "$_old_tag" != "$_current_tag" ]; then
@@ -135,6 +137,9 @@ while true; do
break
fi
+ if $force_release; then
+ do_release=true
+ fi
force=
# check if we need make new release
@@ -151,7 +156,7 @@ while true; do
log "building $_current"
rm -f "$logdir"/$hostname.log
rc=0
- for repo in $repos; do
+ ! $skip_build && for repo in $repos; do
if ! build $repo >>"$logdir"/$hostname.log 2>&1 ; then
errlog=$hostname.$_current.log
cp "$logdir"/$hostname.log "$logdir"/$errlog
@@ -171,7 +176,7 @@ while true; do
fi
log "uploading packages to $repo"
- for i in $upload_pkg; do
+ $use_network && for i in $upload_pkg; do
rsync -rui --delete-delay --delay-updates \
$repo/$arch $i/$repo/ > /tmp/upload-$repo
if [ $? -ne 0 ]; then
@@ -185,11 +190,8 @@ while true; do
done
[ $rc -eq 0 ] && touch /tmp/uploaded && sudo apk update
- 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"
- fi
+ if $do_release && create_release ${_current_tag#v}; then
+ $upload_msg "$rel/releases/$arch"
fi
done