From 39e73a0ea2956fb2e9fc06b206c8c11da8cffaf4 Mon Sep 17 00:00:00 2001
From: Dragos Iulian ARGINT <dragos.argint@stud.acs.upb.ro>
Date: Sun, 19 Mar 2023 12:39:24 +0200
Subject: [PATCH] Update checker.sh and pipeline

Signed-off-by: Dragos Iulian ARGINT <dragos.argint@stud.acs.upb.ro>
---
 .gitlab-ci.yml     |  3 ++-
 checker/checker.sh | 12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 01c7dc0..c6b186b 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,6 +10,7 @@ variables:
   CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest
   DOCKER_HOST: tcp://docker:2375
   DOCKER_TLS_CERTDIR: ""
+  ASSIGNMENT: 0-list
 
 
 build:
@@ -28,4 +29,4 @@ checker:
     image:
         name: gitlab.cs.pub.ro:5050/so2/0-list
     script:
-        - echo ""
+        - ./checker/checker.sh $ASSIGNMENT
diff --git a/checker/checker.sh b/checker/checker.sh
index a3a8097..e0da790 100755
--- a/checker/checker.sh
+++ b/checker/checker.sh
@@ -32,10 +32,16 @@ run_checker()
 	
 	local module_path="${assignment_dir}/${assignment_mod}"
 
+	echo "Copying the contents of src/ into $assignment_dir"
+	cp src/* $assignment_dir
+
+	echo "Checking if $assignment_mod exists before build"
+	if [ -f $module_path ]; then
+			echo "$assignment_mod shouldn't exists. Removing ${module_path}"
+			rm $module_path
+	fi
+		
 	pushd /linux/tools/labs
-		if [ -f $module_path ]; then
-			echo "Removing ${module_path}"
-		fi
 		if [ -f $output ]; then
 			echo "Removing $output"
 			rm $output &> /dev/null
-- 
GitLab