From 5e374a0784ed16705396fa4398976a5e9e161ee4 Mon Sep 17 00:00:00 2001
From: Tobias Kregelin <tobiak04@zedat.fu-berlin.de>
Date: Sat, 8 Feb 2025 00:19:25 +0100
Subject: [PATCH] Finish first build - add artifacts and expire_in for build
 job - add input based artifact path (output_file_name) - fix errors and
 remove tests from bash script

---
 templates/nasm-basic.yml | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/templates/nasm-basic.yml b/templates/nasm-basic.yml
index 05ac9d4..c2cfe67 100644
--- a/templates/nasm-basic.yml
+++ b/templates/nasm-basic.yml
@@ -22,6 +22,9 @@ spec:
       type: array
       default: []
       description: 'Array of files to be included in build. Defaults to all .asm and .c files'
+    output_file_name:
+      default: 'my_program'
+      description: 'Name of the generated output file'
 
 ---
 
@@ -45,6 +48,8 @@ variables:
 .base_container:
   #Base Container loading the defined Docker Image. 
   image: $CONTAINER_IMAGE
+
+default:
   before_script:
     - |
       format_build_start() {
@@ -60,12 +65,6 @@ variables:
         echo -e $f_rainbow_test_start
         echo -e $f_line_white
       }
-    - |
-      run_tests() {
-        echo -e "$[[ inputs.program-files ]][1]" #rn used for testing only
-      }
-    #TODO run_tests function 
-
 
 #Build default
 build-latest:
@@ -164,8 +163,9 @@ build-latest:
         done
 
       fi
-    - ls
-    - ld *.o -o my_program
-    - gcc *.o -o my_program_c
+    - ld *.o -o '$[[ inputs.output_file_name ]]'
     - format_build_end
-    - run_tests
\ No newline at end of file
+  artifacts:
+    paths:
+      - $[[ inputs.output_file_name ]]
+    expire_in: 1 day
\ No newline at end of file
-- 
GitLab