From 8a7e1ca024696242b4fb1bdb9b0711de4cc5f1f5 Mon Sep 17 00:00:00 2001 From: Sohrab Behdani Date: Sat, 5 Oct 2024 14:23:35 +0330 Subject: [PATCH] added arm build --- .gitlab-ci.yaml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .gitlab-ci.yaml diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yaml new file mode 100644 index 0000000..d3029dc --- /dev/null +++ b/.gitlab-ci.yaml @@ -0,0 +1,63 @@ +stages: + - build + - deploy + +image: archlinux/archlinux:base-devel + +variables: + Desktop: "plasma" + ARCHITECTURES: "aarch64 rpi-aarch64" # Set architectures for the matrix + FLAVORS: "barebone plasma xfce trinity" # Set flavors to simulate a matrix + Remote_Path: "/srv/http/arm/" + +# Build stage: builds ISO files for multiple architectures and flavors +build_iso: + stage: build + script: + - echo "Starting ISO build for ARM platforms" + - for arch in $ARCHITECTURES; do + for flavor in $FLAVORS; do + scripts=(); + for script_name in "$arch" "$flavor" "$arch-$flavor"; do + script_path="setup/$script_name"; + if [ -f "$script_path" ]; then + scripts+=("$script_path"); + fi; + done; + echo "Building image for $arch with $flavor"; + sudo ./create-image 9G "$arch" "${scripts[@]}"; + image_in_name="archlinux-${arch}.img"; + image_out_name="ParchLinux-${arch}-${flavor}-$(date '+%Y-%m-%d').img"; + mv "$image_in_name" "$image_out_name"; + echo "Compressing $image_out_name with xz"; + xz -z "$image_out_name"; + done; + done; + artifacts: + paths: + - "*.img.xz" # Save all .xz compressed images as artifacts + rules: + - if: $CI_COMMIT_TAG # Only run on tag pushes + +# Deploy stage: uploads ISO files to a remote server +deploy_iso: + stage: deploy + dependencies: + - build_iso # Deploy depends on the build_iso job completion + 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 $Remote_Path" + - echo "Creating new directory on remote host" + - sshpass -p "$PASS" ssh -o StrictHostKeyChecking=no parch@$SSH_ROOT "mkdir -p $Remote_Path" + - echo "Uploading new compressed images via rsync" + - for arch in $ARCHITECTURES; do + for flavor in $FLAVORS; do + image_file="ParchLinux-${arch}-${flavor}-$(date '+%Y-%m-%d').img.xz"; + sshpass -p "$PASS" rsync -r "$image_file" parch@$SSH_ROOT:$Remote_Path; + done; + done; + rules: + - if: $CI_COMMIT_TAG # Only run on tag pushes +