From e753a4d1af740a3cfeb4a4c994395f3a0a5a3c73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 2 Sep 2018 22:55:51 +0200 Subject: alpine-amd64: try to change how we do chroot --- jobs/alpine-amd64.run | 63 +-------------------------------------------------- jobs/alpine-amd64.sh | 55 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+), 62 deletions(-) create mode 100755 jobs/alpine-amd64.sh (limited to 'jobs') diff --git a/jobs/alpine-amd64.run b/jobs/alpine-amd64.run index 96bfb2b..80e8644 100755 --- a/jobs/alpine-amd64.run +++ b/jobs/alpine-amd64.run @@ -6,68 +6,7 @@ set -e if [ -n "$CLEAN" ]; then echo_stage "Remove root" flock --exclusive "$WORKSPACE/root.lock" uroot rm -rf "$WORKSPACE/root" - exit 0 fi -cat >abuild-system.conf < .abuild/abuild.conf -EEOF - uroot cp ~/alpinelinux.rsa.key "$ROOT/home/build/.abuild/key.rsa" - uchroot "$ROOT" root chown build:build "/home/build/.abuild/key.rsa" - uroot cp ~/alpinelinux.rsa.key.pub "$ROOT/etc/apk/keys/cynerd@email.cz-5b8aeb6d.rsa.pub" - uroot cp abuild-system.conf "$ROOT/etc/abuild.conf" - fi - - echo_stage "Update system" - uchroot "$ROOT" root /bin/sh -ce 'apk update && apk upgrade' - - echo_stage "Update package sources" - git_clone "git@cynerd.cz:alpine-personal-pkgs" "aports" - uroot rm -rf "$ROOT/home/build/aports" - uroot mv aports "$ROOT/home/build/aports" - uchroot "$ROOT" root chown -R build:build /home/build/aports - - echo_stage "Build packages" - # TODO generate list of repositories automatically - uchroot "$ROOT" build:build buildrepo --purge personal hacked -EOF +flock --exclusive "$WORKSPACE/root.lock" "$(readlink -f "$0" | sed 's/\.run$/\.sh/')" diff --git a/jobs/alpine-amd64.sh b/jobs/alpine-amd64.sh new file mode 100755 index 0000000..e5a6df3 --- /dev/null +++ b/jobs/alpine-amd64.sh @@ -0,0 +1,55 @@ +#!/bin/sh +. utils + +# 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 + 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 cat >"$ROOT/etc/abuild.conf" <