aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Dockerfile3
-rw-r--r--Jenkinsfile72
2 files changed, 43 insertions, 32 deletions
diff --git a/Dockerfile b/Dockerfile
index 1b6ef69..2577c04 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -24,6 +24,9 @@ WORKDIR /app
COPY . .
+# Initialize git submodules inside the container
+RUN git submodule update --init --recursive
+
# Creates the .lush config directory in the root user home directory as install.sh expects.
RUN mkdir -p /root/.lush && cp -r ./.lush/* /root/.lush/
diff --git a/Jenkinsfile b/Jenkinsfile
index f3ffb15..6512f35 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,3 +1,5 @@
+// In Jenkinsfile
+
pipeline {
agent any
@@ -5,19 +7,7 @@ pipeline {
stage('Build Application Image') {
steps {
script {
- echo 'Initializing Git submodules...'
- sh 'git submodule update --init --recursive'
-
- // Debug: Check if submodules are populated ON JENKINS AGENT
- echo 'Checking submodule status on Jenkins agent...'
- sh 'git submodule status'
-
- echo 'Checking lib directory contents on Jenkins agent...'
- sh 'ls -la lib/ || echo "lib directory not found"'
- sh 'find lib/ -name "*.c" -o -name "*.h" | head -10 || echo "No C files found in lib"'
- sh 'ls -la lib/compat53/ || echo "compat53 not found"'
- sh 'ls -la lib/compat53/c-api/ || echo "c-api directory not found"'
-
+ // NOTE: Dockerfile handles submodule initialization
echo 'Building the Lush application Docker image...'
sh 'docker build -t lush-app:latest .'
}
@@ -32,36 +22,54 @@ pipeline {
echo 'Creating test script on Jenkins agent...'
sh '''
cat <<'EOF' > test_52.lua
+-- Lua 5.2-specific features test
print("--- Running Lua 5.2 Compatibility Test ---")
+
+-- Test 1: Basic functionality
print("Basic print test: Hello from Lush!")
-print("--- Test Complete ---")
+
+-- Test 2: Bitwise operations using the preloaded bit32 library
+local a, b = 5, 3
+print("Bitwise AND of", a, "and", b, "=", bit32.band(a, b))
+print("Bitwise OR of", a, "and", b, "=", bit32.bor(a, b))
+
+-- Test 3: load() function (replaces loadstring in Lua 5.2)
+local f, err = load("return 10 + 20")
+if f then
+ print("Loaded function result:", f())
+else
+ print("Failed to load function:", err)
+end
+
+-- Test 4: table.unpack
+local t = {1, 2, 3}
+print("Unpacked values:", table.unpack(t))
+
+-- Test 5: String operations
+local str = "Hello, World!"
+print("String length:", #str)
+print("Substring:", string.sub(str, 1, 5))
+
+-- Test 6: Math operations
+print("Math operations:")
+print(" sqrt(16) =", math.sqrt(16))
+print(" max(10, 20, 5) =", math.max(10, 20, 5))
+
+print("--- Test Complete: All basic features working ---")
EOF
'''
echo 'Creating and starting the build container...'
sh "docker run -d --name ${containerName} lush-app:latest sleep infinity"
- echo 'Copying complete workspace (with populated submodules) into container...'
- sh "docker cp . ${containerName}:/app/"
-
- // Debug: Check what's actually in the container AFTER copying
- echo 'Debugging: Checking container contents AFTER workspace copy...'
- sh "docker exec ${containerName} ls -la /app/lib/ || echo 'lib directory empty or missing in container'"
- sh "docker exec ${containerName} ls -la /app/lib/compat53/ || echo 'compat53 not found in container'"
- sh "docker exec ${containerName} ls -la /app/lib/compat53/c-api/ || echo 'c-api not found in container'"
- sh "docker exec ${containerName} find /app/lib/ -name '*.c' | head -5 || echo 'No C files found in container lib'"
-
echo 'Copying test script into the container...'
sh "docker cp test_52.lua ${containerName}:/app/test_52.lua"
- echo 'Running premake5 to see what it generates...'
- sh "docker exec ${containerName} /bin/bash -c 'cd /app && premake5 gmake2'"
-
- echo 'Checking generated Makefile...'
- sh "docker exec ${containerName} /bin/bash -c 'cd /app && head -50 lush.make | grep -i compat || echo \"No compat references found\"'"
+ 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'"
- echo 'Attempting to compile...'
- sh "docker exec ${containerName} /bin/bash -c 'cd /app && make'"
+ echo 'Extracting compiled binary from the container...'
+ sh "docker cp ${containerName}:/app/bin ./"
} finally {
echo "Cleaning up build container: ${containerName}"
@@ -78,4 +86,4 @@ EOF
sh 'docker rmi lush-app:latest || true'
}
}
-} \ No newline at end of file
+}
-1/+1 2011-07-24dmenu_run: sh -cGravatar Connor Lane Smith 1-1/+1 2011-07-22fix loadfontGravatar Connor Lane Smith 1-12/+13 2011-07-19Added tag 4.4 for changeset 2b105eaae831Gravatar Connor Lane Smith 1-0/+1 2011-07-19add lsx.1 to distGravatar Connor Lane Smith 1-1/+1 2011-07-17tweaksGravatar Connor Lane Smith 2-2/+2 2011-07-14efficiency tweaksGravatar Connor Lane Smith 2-60/+44 2011-07-14fix extra warningGravatar Connor Lane Smith 1-1/+1 2011-07-06simpler vlineGravatar Connor Lane Smith 1-4/+2 2011-07-04rebind ^N ^PGravatar Connor Lane Smith 2-3/+3 2011-06-25include limits.hGravatar Connor Lane Smith 1-0/+1 2011-06-23make clean lsxGravatar Connor Lane Smith 1-1/+1 2011-06-23lsx: check snprintfGravatar Connor Lane Smith 1-4/+3 2011-06-18update draw.cGravatar Connor Lane Smith 2-14/+14 2011-06-18simpler lsxGravatar Connor Lane Smith 3-11/+6 2011-06-13new dmenu_runGravatar Connor Lane Smith 5-26/+15