diff options
Diffstat (limited to '')
| -rw-r--r-- | Dockerfile | 32 | ||||
| -rw-r--r-- | Dockerfile.jenkins | 40 | ||||
| -rw-r--r-- | Jenkinsfile | 95 | ||||
| -rw-r--r-- | docker-compose.yml | 18 |
4 files changed, 0 insertions, 185 deletions
diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index e6dc2a7..0000000 --- a/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# In Dockerfile
-
-# Use a base image with build tools
-FROM ubuntu:22.04
-
-# Avoid interactive prompts during package installation
-ENV DEBIAN_FRONTEND=noninteractive
-
-# Install necessary build tools for your C project
-RUN apt-get update && apt-get install -y \
- build-essential \
- wget \
- unzip \
- git \
- lua5.4 \
- liblua5.4-dev \
- && rm -rf /var/lib/apt/lists/*
-
-# Download and install Premake5
-RUN wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz -O premake.tar.gz && \
- tar -xvf premake.tar.gz && \
- mv premake5 /usr/local/bin/
-
-# Set the working directory inside the container
-WORKDIR /app
-
-COPY . .
-
-# 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/Dockerfile.jenkins b/Dockerfile.jenkins deleted file mode 100644 index 23a95f1..0000000 --- a/Dockerfile.jenkins +++ /dev/null @@ -1,40 +0,0 @@ -# Dockerfile.jenkins
-# Use the official Jenkins image as a base
-FROM jenkins/jenkins:lts-jdk17
-
-# Pass Host User, Group, and Docker Group IDs as build arguments
-ARG UID
-ARG GID
-ARG DOCKER_GID
-
-# Switch to root user to install dependencies and manage users
-USER root
-
-# Install Docker CLI so Jenkins can interact with the host's Docker daemon
-RUN apt-get update && apt-get install -y lsb-release sudo
-RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
- https://download.docker.com/linux/debian/gpg
-RUN echo "deb [arch=$(dpkg --print-architecture) \
- signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
- https://download.docker.com/linux/debian \
- $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
-RUN apt-get update && apt-get install -y docker-ce-cli
-
-# Create a docker group with the host's GID to match permissions
-# and add the jenkins user to it.
-RUN if [ -n "$DOCKER_GID" ]; then \
- groupadd -g $DOCKER_GID docker && \
- usermod -aG docker jenkins; \
- fi
-
-# Change the jenkins user and group to match the host.
-# This should ensure file permissions for the jenkins_home volume are correct.
-RUN if [ -n "$GID" ] && [ "$(getent group jenkins | cut -d: -f3)" != "$GID" ]; then \
- groupmod -g $GID jenkins; \
- fi
-RUN if [ -n "$UID" ] && [ "$(id -u jenkins)" != "$UID" ]; then \
- usermod -u $UID jenkins; \
- fi
-
-# Switch to the newly configured jenkins user
-USER jenkins
diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index dccf6b9..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,95 +0,0 @@ -// In Jenkinsfile
-
-pipeline {
- agent any
-
- stages {
- stage('Build Application Image') {
- steps {
- script {
- 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 .'
- }
- }
- }
- stage('Compile & Test Project') {
- steps {
- script {
- def containerName = "lush-build-${BUILD_NUMBER}"
-
- try {
- 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!")
-
--- 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"
-
- // 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"
-
- 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 'Extracting compiled binary from the container...'
- sh "docker cp ${containerName}:/app/bin ./"
-
- } finally {
- echo "Cleaning up build container: ${containerName}"
- sh "docker stop ${containerName} >/dev/null 2>&1 || true"
- sh "docker rm ${containerName} >/dev/null 2>&1 || true"
- }
- }
- }
- }
- }
- post {
- always {
- echo 'Pipeline finished.'
- sh 'docker rmi lush-app:latest || true'
- }
- }
-}
diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 0cccadc..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,18 +0,0 @@ -# docker-compose.yml
-services:
- jenkins:
- build:
- context: .
- dockerfile: Dockerfile.jenkins
- args:
- # Pass all necessary host IDs to the build
- UID: ${UID}
- GID: ${GID}
- DOCKER_GID: ${DOCKER_GID}
- ports:
- - "8080:8080"
- - "50000:50000"
- container_name: jenkins
- volumes:
- - ./jenkins_home:/var/jenkins_home
- - /var/run/docker.sock:/var/run/docker.sock
\ No newline at end of file |
