parch-runit/.gitlab-ci.yml

59 lines
1.8 KiB
YAML
Raw Normal View History

2024-09-28 14:49:40 +03:30
stages:
- build
- deploy
2024-09-28 14:56:34 +03:30
image: artixlinux/artixlinux:base-runit
2024-09-28 14:49:40 +03:30
variables:
Desktop: "runit"
build_iso:
stage: build
script:
- echo "Installing artools"
- pacman --noconfirm -Sy artools iso-profiles
- echo "Setting up filesystem for the build"
- dd if=/dev/zero of=/tmp/loopfs.img bs=1024 count=8000000
2024-09-28 15:41:48 +03:30
- losetup /dev/loop8 /tmp/loopfs.img
- mkfs.ext4 /dev/loop8
2024-09-28 14:49:40 +03:30
- mkdir -p /var/lib/artools
2024-09-28 15:41:48 +03:30
- mount /dev/loop8 /var/lib/artools
2024-09-28 14:49:40 +03:30
- echo "Starting the ISO build process"
- mkdir -p ~/artools-workspace/iso-profiles
- cp base ~/artools-workspace/iso-profiles -r
- mkdir -p ~/.config/artools
2024-09-28 15:33:44 +03:30
- ls config/
2024-09-28 14:49:40 +03:30
- cp config/pacman.conf /usr/share/artools/pacman.conf.d/default.conf
2024-09-28 15:41:48 +03:30
- mkdir -p /root/.config/artools/
- cp config/pacman.conf /root/.config/artools/pacman-default.conf
2024-09-28 15:33:44 +03:30
- cp config/pacman.conf /etc/pacman.conf
- cp -r config/parch-mirrors /etc/pacman.d/
2024-09-28 14:49:40 +03:30
- ./build-iso.sh
- echo "Renaming the output ISO file"
- mv out/*.iso out/ParchLinux-$Desktop-latest.iso
artifacts:
paths:
- out/ParchLinux-$Desktop-latest.iso
rules:
- if: $CI_COMMIT_TAG
2024-09-28 15:22:32 +03:30
services:
- docker:dind
2024-09-28 14:49:40 +03:30
deploy_iso:
stage: deploy
dependencies:
- build_iso
script:
- echo "Installing sshpass and rsync"
- pacman -Syu --noconfirm sshpass rsync
- echo "Removing old ISO files from remote directory"
- sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no parch@$SSH_ROOT rm -rf /srv/http/$Desktop/
- echo "Creating new directory on remote host"
- sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no parch@$SSH_ROOT mkdir -p /srv/http/$Desktop/
- echo "Uploading new ISO via rsync"
- sshpass -p "$PASS" rsync -r out/ParchLinux-$Desktop-latest.iso parch@$SSH_ROOT:/srv/http/$Desktop/
rules:
- if: $CI_COMMIT_TAG
2024-09-28 15:19:24 +03:30
2024-09-28 15:20:52 +03:30