Skip to content
Snippets Groups Projects
Commit 20a91ba4 authored by Burhan Akbar's avatar Burhan Akbar
Browse files

Adjusting a bigger change deploys v6..losinghope</3...

parent e3314e86
No related branches found
No related tags found
No related merge requests found
pipeline {
agent any
agent any // Or your specific agent label
// Define reusable environment variables.
environment {
......@@ -9,19 +9,32 @@ pipeline {
SSH_CRED_ID = "appvm-ssh-cred"
}
// Add options block for workspace cleanup
options {
// Set an overall timeout for the pipeline.
timeout(time: 30, unit: 'MINUTES')
// Clean workspace before checkout
skipDefaultCheckout true // We'll handle checkout manually after cleaning
wipeWorkspace()
}
stages {
// Add a stage for manual checkout after cleaning
stage('Checkout') {
steps {
// Clone the GitLab repo. Note the SSH URL uses "git" as the username.
git branch: 'ba',
url: 'git@git.cardiff.ac.uk:c24025433/healthcare.git',
credentialsId: 'gitlab-ssh-key'
echo "Wiping workspace completed by options block."
echo "Performing manual checkout..."
// Use your actual Git checkout command here if different
// Ensure you specify the correct branch ('ba')
checkout([
$class: 'GitSCM',
branches: [[name: '*/ba']],
userRemoteConfigs: [[
credentialsId: 'gitlab-ssh-key', // Make sure GIT_CRED_ID is defined in Jenkins environment
url: 'git@git.cardiff.ac.uk:c24025433/healthcare.git' // Your Git URL
]]
])
echo "Checkout complete."
}
}
......@@ -29,11 +42,33 @@ pipeline {
steps {
// Ensure gradlew is executable
sh 'chmod +x gradlew'
// --- BEGIN DEBUGGING ---
echo "--- Checking source file content AFTER checkout ---"
sh 'cat src/main/resources/static/html/beds.html || echo "Source beds.html not found!"'
echo "-------------------------------------------------"
// More aggressive clean: remove .gradle cache and force task rerun
// build/ is removed by wipeWorkspace() now, but rm -rf .gradle/ is still good
sh '''
rm -rf .gradle/
./gradlew --no-daemon --max-workers=1 clean build --rerun-tasks
'''
// --- MORE DEBUGGING ---
echo "--- Checking JAR file content AFTER build ---"
sh '''
echo "Listing JAR contents for beds.html:"
jar tf build/libs/HealthCare-0.0.1-SNAPSHOT.jar | grep beds.html || echo "beds.html not found in JAR!"
echo "Extracting beds.html from JAR:"
mkdir -p /tmp/jenkins-jar-extract/BOOT-INF/classes/static/html
jar xf build/libs/HealthCare-0.0.1-SNAPSHOT.jar -C /tmp/jenkins-jar-extract BOOT-INF/classes/static/html/beds.html || echo "Failed to extract beds.html from JAR!"
echo "Content of beds.html extracted from JAR:"
cat /tmp/jenkins-jar-extract/BOOT-INF/classes/static/html/beds.html || echo "Failed to cat extracted beds.html!"
rm -rf /tmp/jenkins-jar-extract
'''
echo "---------------------------------------------"
// --- END DEBUGGING ---
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment