diff options
| -rw-r--r-- | Dockerfile | 6 | ||||
| -rw-r--r-- | Jenkinsfile | 8 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,5 @@ +# In Dockerfile
+
# Use a base image with build tools
FROM ubuntu:22.04
@@ -24,11 +26,7 @@ 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/
CMD ["premake5", "gmake2"]
-
diff --git a/Jenkinsfile b/Jenkinsfile index 6512f35..dccf6b9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,7 +7,12 @@ pipeline { stage('Build Application Image') {
steps {
script {
- // NOTE: Dockerfile handles submodule initialization
+ echo 'Initializing Git submodules...'
+ // First, sync the submodule URLs from .gitmodules to .git/config
+ sh 'git submodule sync --recursive'
+ // Then, initialize and update the submodules
+ sh 'git submodule update --init --recursive'
+
echo 'Building the Lush application Docker image...'
sh 'docker build -t lush-app:latest .'
}
@@ -62,6 +67,7 @@ EOF echo 'Creating and starting the build container...'
sh "docker run -d --name ${containerName} lush-app:latest sleep infinity"
+ // Since the Docker image now has the full source, we only need to copy the test script.
echo 'Copying test script into the container...'
sh "docker cp test_52.lua ${containerName}:/app/test_52.lua"
|
