From 12a94cdb3c9f51d01513108cd8ca4edeb806d989 Mon Sep 17 00:00:00 2001 From: Andrew D. France Date: Wed, 23 Jul 2025 03:06:05 -0500 Subject: CRITICAL FOR TESTING: This copies the entire Jenkins workspace (including the populated lib/ directory from the submodules) into the running container, ensuring all the required source files are available for the build process. --- Dockerfile | 1 + Jenkinsfile | 15 ++++++--------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac570c7..1b6ef69 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \ build-essential \ wget \ unzip \ + git \ lua5.4 \ liblua5.4-dev \ && rm -rf /var/lib/apt/lists/* diff --git a/Jenkinsfile b/Jenkinsfile index 51a46d8..6acbacd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,5 +1,3 @@ -// Jenkinsfile - pipeline { agent any @@ -8,7 +6,6 @@ pipeline { steps { script { echo 'Initializing Git submodules...' - // Manually initialize and update the git submodules sh 'git submodule update --init --recursive' echo 'Building the Lush application Docker image...' @@ -19,7 +16,6 @@ pipeline { stage('Compile & Test Project') { steps { script { - // Define a unique name for our temporary build container def containerName = "lush-build-${BUILD_NUMBER}" try { @@ -65,21 +61,22 @@ EOF ''' echo 'Creating and starting the build container...' - // Create the container and keep it running in the background sh "docker run -d --name ${containerName} lush-app:latest sleep infinity" + echo 'Copying complete workspace (with populated submodules) into container...' + // This ensures the populated lib/ directory gets into the container + sh "docker cp . ${containerName}:/app/" + echo 'Copying test script into the container...' sh "docker cp test_52.lua ${containerName}:/app/test_52.lua" echo 'Compiling and running tests inside the container...' - sh "docker exec ${containerName} /bin/bash -c 'premake5 gmake2 && make && ./bin/Debug/lush/lush test_52.lua'" + sh "docker exec ${containerName} /bin/bash -c 'cd /app && premake5 gmake2 && make && ./bin/Debug/lush/lush test_52.lua'" echo 'Extracting compiled binary from the container...' - // This is good practice for storing build artifacts sh "docker cp ${containerName}:/app/bin ./" } finally { - // This block ensures the build container is always stopped and removed echo "Cleaning up build container: ${containerName}" sh "docker stop ${containerName} >/dev/null 2>&1 || true" sh "docker rm ${containerName} >/dev/null 2>&1 || true" @@ -94,4 +91,4 @@ EOF sh 'docker rmi lush-app:latest || true' } } -} +} \ No newline at end of file -- cgit v1.2.3-59-g8ed1b