197 lines
8.9 KiB
Groovy
197 lines
8.9 KiB
Groovy
pipeline {
|
|
agent { label 'pyDABFActory-CIAgent' }
|
|
stages {
|
|
stage('Prepare Docker cache markers') {
|
|
steps {
|
|
sh '''
|
|
mkdir -p .docker-cache
|
|
git ls-remote https://gitea.chacha.ddns.net/chacha/glide.git refs/heads/retrodebian \
|
|
| awk '{print $1}' > .docker-cache/glide.ref
|
|
test -s .docker-cache/glide.ref
|
|
echo "glide ref: $(cat .docker-cache/glide.ref)"
|
|
|
|
git ls-remote https://gitea.chacha.ddns.net/chacha/UT99-Official.git refs/heads/master \
|
|
| awk '{print $1}' > .docker-cache/ut99.ref
|
|
test -s .docker-cache/ut99.ref
|
|
echo "ut99 ref: $(cat .docker-cache/ut99.ref)"
|
|
'''
|
|
}
|
|
}
|
|
stage('Convert images')
|
|
{
|
|
agent {
|
|
docker {
|
|
image 'dpokidov/imagemagick'
|
|
reuseNode true
|
|
}
|
|
}
|
|
steps {
|
|
sh '''
|
|
set -eu
|
|
|
|
found_edition=0
|
|
|
|
for edition_dir in editions/*; do
|
|
[ -d "$edition_dir" ] || continue
|
|
found_edition=1
|
|
|
|
set -- "$edition_dir"/splash-source.*
|
|
if [ ! -e "$1" ]; then
|
|
echo "ERROR: missing splash-source.* in $edition_dir" >&2
|
|
exit 1
|
|
fi
|
|
if [ $# -ne 1 ]; then
|
|
echo "ERROR: multiple splash-source.* files in $edition_dir" >&2
|
|
exit 1
|
|
fi
|
|
|
|
src="$1"
|
|
out="$edition_dir/splash.jpg"
|
|
|
|
echo "Converting $src -> $out"
|
|
|
|
magick "$src" \
|
|
-resize 640x480! \
|
|
-background black \
|
|
-alpha remove -alpha off \
|
|
-colorspace sRGB \
|
|
-strip \
|
|
-quality 95 \
|
|
"$out"
|
|
done
|
|
|
|
if [ "$found_edition" -eq 0 ]; then
|
|
echo "ERROR: no edition directory found under editions/" >&2
|
|
exit 1
|
|
fi
|
|
'''
|
|
}
|
|
}
|
|
stage('Create live')
|
|
{
|
|
agent {
|
|
dockerfile {
|
|
filename 'Dockerfile'
|
|
dir '.'
|
|
label 'pyDABFActory-CIAgent'
|
|
// additionalBuildArgs '--no-cache-filter fetcher'
|
|
args '--privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined -u root:root'
|
|
reuseNode true
|
|
}
|
|
}
|
|
stages {
|
|
stage('Configure ISO') {
|
|
steps {
|
|
dir('root')
|
|
{
|
|
sh 'rm -Rf live artifacts'
|
|
}
|
|
dir('root/live')
|
|
{
|
|
sh '''
|
|
set -e
|
|
deb="$(ls -1 /root/linux-image-*.deb | head -n1)"
|
|
kernpkg="$(dpkg-deb -f "$deb" Package)"
|
|
echo "$kernpkg"
|
|
|
|
deb="$(ls -1 /root/squashfs-modules-*.deb | head -n1)"
|
|
squashfspkg="$(dpkg-deb -f "$deb" Package)"
|
|
echo "$squashfspkg"
|
|
|
|
lh_config \
|
|
-a i386 \
|
|
--distribution etch \
|
|
--apt apt \
|
|
--apt-options "--yes --force-yes" \
|
|
--apt-secure false \
|
|
--apt-recommends false \
|
|
--linux-packages "squashfs-modules-2.6.24 linux-image-2.6.24 device3dfx-modules-2.6.24" \
|
|
--packages-lists "desktop" \
|
|
--mirror-bootstrap http://archive.debian.org/debian/ \
|
|
--mirror-binary http://archive.debian.org/debian/ \
|
|
--mirror-binary-security http://archive.debian.org/debian-security/ \
|
|
--mirror-chroot http://archive.debian.org/debian/ \
|
|
--mirror-chroot-security http://archive.debian.org/debian-security/ \
|
|
--binary-images iso \
|
|
--bootloader syslinux \
|
|
--syslinux-timeout 5 \
|
|
--syslinux-menu true \
|
|
--bootstrap debootstrap \
|
|
--debconf-frontend noninteractive \
|
|
--debian-installer live \
|
|
--bootappend-live "elevator=deadline" \
|
|
--hostname RetroDebian \
|
|
--iso-application RetroDebian \
|
|
--syslinux-splash config/binary_syslinux/splash.jpg \
|
|
--union-filesystem unionfs \
|
|
--username bob \
|
|
--templates config/templates \
|
|
-k retrodebian1
|
|
|
|
cp -R /usr/share/live-helper/templates/* config/templates/
|
|
|
|
sed -i \
|
|
-e 's|^menu color sel.*|menu color sel * #ff82c059 #c0000000 none|' \
|
|
-e 's|^menu color unsel.*|menu color unsel * #8082c059 #00000000 none|' \
|
|
-e 's|^menu color hotkey.*|menu color hotkey * #fff01e1e #00000000 none|' \
|
|
config/templates/syslinux/menu/header.cfg
|
|
|
|
chmod +x /root/update-initramfs.sh
|
|
chmod +x /root/zzz-config-live.sh
|
|
cp /root/update-initramfs.sh config/chroot_local-hooks
|
|
cp /root/zzz-config-live.sh config/chroot_local-hooks
|
|
cp /root/linux-image-*.deb config/chroot_local-packages/
|
|
cp /root/device3dfx-*.deb config/chroot_local-packages/
|
|
cp /root/squashfs-modules-*.deb config/chroot_local-packages/
|
|
cp /root/libglide*-cvg*_i386.deb config/chroot_local-packages/
|
|
cp /root/desktop config/chroot_local-packageslists/
|
|
mkdir -p config/chroot_local-includes/usr/share/wallpapers
|
|
cp /root/wallpaper.jpg config/chroot_local-includes/usr/share/wallpapers/retrodebian.jpg
|
|
mkdir -p config/chroot_local-includes/usr/local/bin
|
|
cp /root/neofetch config/chroot_local-includes/usr/local/bin/neofetch
|
|
chmod +x config/chroot_local-includes/usr/local/bin/neofetch
|
|
cp /root/editions/voodoo2/splash.jpg config/binary_syslinux/
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Configure games') {
|
|
steps {
|
|
dir('root/live') {
|
|
sh '''
|
|
mkdir -p config/chroot_local-includes/usr/local/games/ut99/
|
|
cp -R /root/ut-game/* config/chroot_local-includes/usr/local/games/ut99/
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
stage('Build ISO') {
|
|
steps {
|
|
dir('root/live')
|
|
{
|
|
sh 'lh_build'
|
|
}
|
|
}
|
|
}
|
|
stage('Save artifacts') {
|
|
steps {
|
|
dir('root')
|
|
{
|
|
sh '''
|
|
mkdir artifacts
|
|
mv /root/*.deb artifacts/
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
success {
|
|
archiveArtifacts artifacts: 'root/live/*.iso', fingerprint: true
|
|
archiveArtifacts artifacts: 'root/artifacts/*.deb', fingerprint: true
|
|
deleteDir()
|
|
}
|
|
}
|
|
} |