gentoo-builder/entrypoint.sh

46 lines
1.2 KiB
Bash
Raw Permalink Normal View History

2018-11-25 20:20:42 +01:00
#!/bin/sh
2018-11-04 03:49:15 +01:00
die() {
echo $* >&2
exit 1
}
2018-11-26 08:47:40 +01:00
set -e
2019-11-11 17:05:28 +01:00
BUILD_DIR=/var/lib/catalyst/store/builds/default
RELEASE_BASE_URI=https://gentoo.osuosl.org/releases
2019-03-20 15:26:48 +01:00
2019-11-11 17:05:28 +01:00
if [ ! -r ${BUILD_DIR}/stage3-amd64-latest.tar.xz ] \
&& [ ! -r ${BUILD_DIR}/stage3-amd64-latest.tar.bz2 ]
then
# Get latest stage3 tag
STAGE3_TAG=$(wget -q -O - \
2019-11-11 17:05:28 +01:00
${RELEASE_BASE_URI}/amd64/autobuilds/latest-stage3-amd64.txt \
| grep -v "^#" | cut -d ' ' -f 1)
# Download latest stable stage3 build
2019-11-11 17:05:28 +01:00
for SUFFIX in "" ".CONTENTS" ".DIGESTS"; do
wget -q -N -P ${BUILD_DIR} \
${RELEASE_BASE_URI}/amd64/autobuilds/${STAGE3_TAG}${SUFFIX}
2019-11-11 17:05:28 +01:00
ln -sf "${BUILDDIR}/$(basename ${STAGE3_TAG})${SUFFIX}" \
"${BUILDDIR}/stage3-amd64-latest.tar.xz${SUFFIX}"
done
fi
2018-11-26 22:37:28 +01:00
2018-11-04 03:49:15 +01:00
# Download latest portage snapshot
2018-11-26 22:37:28 +01:00
wget -q -N -P /var/lib/catalyst/store/snapshots/ \
2019-11-11 17:05:28 +01:00
${RELEASE_BASE_URI}/snapshots/current/portage-latest.tar.bz2
2018-11-04 03:49:15 +01:00
2019-01-17 01:59:36 +01:00
# Build stage1 snapshot
catalyst -c /catalyst.conf -f /stage1.spec -p $*
2019-01-17 01:59:36 +01:00
# Build stage2 snapshot
catalyst -c /catalyst.conf -f /stage2.spec -p $*
2019-01-17 01:59:36 +01:00
# Build stage3 snapshot
catalyst -c /catalyst.conf -f /stage3.spec -p $*
2018-11-04 03:49:15 +01:00
2019-01-17 01:59:36 +01:00
# Build custom packages
2019-01-17 02:23:21 +01:00
catalyst -c /var/lib/catalyst/catalyst.conf -f /var/lib/catalyst/stage4.spec $*