From 577a64a6bc8bb69c3337ad34bcf5f7b33cf50d6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Thu, 20 Sep 2018 10:33:34 +0200 Subject: alpine-amd64: some reformat and add FILES --- files/alpine/abuild.conf | 16 ++++++++++++++++ files/alpine/amd64.sh | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 files/alpine/abuild.conf create mode 100755 files/alpine/amd64.sh (limited to 'files/alpine') diff --git a/files/alpine/abuild.conf b/files/alpine/abuild.conf new file mode 100644 index 0000000..7846d73 --- /dev/null +++ b/files/alpine/abuild.conf @@ -0,0 +1,16 @@ +# vim: ft=sh +export CFLAGS="-Os -fomit-frame-pointer" +export CXXFLAGS="\$CFLAGS" +export CPPFLAGS="\$CFLAGS" +export LDFLAGS="-Wl,--as-needed" + +export JOBS=4 +export MAKEFLAGS=-j\$JOBS + +USE_COLORS=1 + +SRCDEST=/var/cache/distfiles +REPODEST=$HOME/packages/ + +CLEANUP="srcdir bldroot pkgdir deps" +ERROR_CLEANUP="bldroot deps" diff --git a/files/alpine/amd64.sh b/files/alpine/amd64.sh new file mode 100755 index 0000000..e1d0727 --- /dev/null +++ b/files/alpine/amd64.sh @@ -0,0 +1,49 @@ +#!/bin/sh +. utils + +# TODO mount global alpine repository + +# TODO get latest uri from latest-releases.yml file +if [ ! -d "$ROOT" ]; then + echo_stage "Setting up new root" + wget "http://dl-cdn.alpinelinux.org/alpine/edge/releases/x86_64/alpine-minirootfs-3.8.0-x86_64.tar.gz" -O alpine.tar.gz + # TODO verify signature + gunzip alpine.tar.gz + tar -f alpine.tar --delete ./dev/null + mkdir "$ROOT" + uroot tar -xf alpine.tar -C "$ROOT" + chmod 755 "$ROOT" # This is intentional, tar changes access rights + uchroot "$ROOT" root /bin/sh < .abuild/abuild.conf' + uroot cp ~/alpinelinux.rsa.key "$ROOT/build/.abuild/cynerd@email.cz-5b8aeb6d.rsa" + uchroot "$ROOT" root 'chown build:build "/build/.abuild/cynerd@email.cz-5b8aeb6d.rsa"' + uroot cp ~/alpinelinux.rsa.key.pub "$ROOT/etc/apk/keys/cynerd@email.cz-5b8aeb6d.rsa.pub" + uroot cp "$JOB_FILES/abuild.conf" "$ROOT/etc/abuild.conf" +fi + +echo_stage "Update system" +uchroot "$ROOT" root 'apk update && apk upgrade' + +echo_stage "Get packages source" +git_clone "git@cynerd.cz:alpine-personal-pkgs" "$ROOT/pkgs" +uchroot "$ROOT" root "rm -rf /build/aports/personal && chown -R build:build /pkgs && mv /pkgs /build/aports/personal" + +echo_stage "Build packages" +uchroot "$ROOT" build buildrepo --purge personal + +echo_stage "Deploy" +ssh upload rm -rf "deploy-alpine-amd64" +scp -r "$ROOT/build/packages/personal" upload:deploy-alpine +ssh upload /bin/sh -e <