From e66fa7e391e6d43b77bd1d60cb32797b3bc04345 Mon Sep 17 00:00:00 2001
From: Anupam Basak <anupam.basak27@gmail.com>
Date: Tue, 21 Mar 2023 20:25:59 +0530
Subject: [PATCH] Fix image name of custom base image

---
 .gitlab-ci.yml | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f7f70ab..55b9e97 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -23,7 +23,7 @@ build-zynthbox-image-armhf:
     # Update and install dependencies
     - echo "# Update and install dependencies"
     - apt-get update
-    - apt-get install -y coreutils p7zip-full qemu-user-static sudo git wget curl python3 lsof fdisk xz-utils openssh-client jq
+    - apt-get install -y coreutils p7zip-full qemu-user-static sudo git wget curl python3 lsof fdisk xz-utils openssh-client jq zip
 
     # Build custom base image with Low Latency Kernel with PREEMPT_RT patch
     - git clone https://github.com/guysoft/CustomPiOS.git
@@ -33,9 +33,10 @@ build-zynthbox-image-armhf:
     - ../../CustomPiOS/src/update-custompios-paths
     - bash -x ./build_dist
     - prefix=$(ls workspace/*.img | sed "s|workspace/||;s|-raspios-bullseye-armhf-lite.img||")
-    - mv workspace/*.img "/$prefix_$(date +"%d-%m-%Y")-realtimepi-bullseye-armhf-lite.img"
+    - mv workspace/*.img "/${prefix}_$(date +"%d-%m-%Y")-realtimepi-bullseye-armhf-lite.img"
     - cd /
-    - rm -rf CustomPiOS RealtimePi
+    - zip ${prefix}_$(date +"%d-%m-%Y")-realtimepi-bullseye-armhf-lite.img.zip *.img
+    - rm -rf CustomPiOS RealtimePi *.img
 
     # Clone repositories required to generate image
     - echo "# Clone repositories required to generate image"
@@ -49,7 +50,7 @@ build-zynthbox-image-armhf:
 
     # Use custom base image from above
     - echo "# Using custom base image"
-    - mv *.img ./ZynthianOS/src/image
+    - mv *.zip ./ZynthianOS/src/image
 
     # Build rpi4 image
     - echo "# Build rpi4 image"
-- 
GitLab