From 76cd447401141da37ff5a773749154a38eedadaf Mon Sep 17 00:00:00 2001 From: Riz Urian <98958099+rizjosel@users.noreply.github.com> Date: Sat, 27 Dec 2025 10:06:31 +0800 Subject: [PATCH] Update Jenkinsfile.pr Signed-off-by: Riz Urian <98958099+rizjosel@users.noreply.github.com> --- Jenkinsfile.pr | 44 +++++++------------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/Jenkinsfile.pr b/Jenkinsfile.pr index 547788dca..625d2cc04 100644 --- a/Jenkinsfile.pr +++ b/Jenkinsfile.pr @@ -8,18 +8,11 @@ pipeline { IMAGE_NAME = "${DOCKER_USER}/${APP_NAME}:${IMAGE_TAG}" } - triggers { - // Triggered by GitHub Pull Requests - githubPullRequest() - } - stages { stage('Notify GitHub Pending') { steps { - script { - githubNotify context: 'Jenkins CI', status: 'PENDING' - } + githubNotify context: 'Jenkins CI', status: 'PENDING' } } @@ -31,27 +24,14 @@ pipeline { stage('CI / Unit Tests') { steps { - script { - try { - // Run Gradle unit tests - sh './gradlew clean build -x test' - junit 'build/test-results/test/*.xml' - } catch (err) { - error "Unit tests failed!" - } - } + sh './gradlew clean build -x test' + junit 'build/test-results/test/*.xml' } } stage('CI / Docker Build') { steps { - script { - try { - sh "docker build -t ${IMAGE_NAME} ." - } catch (err) { - error "Docker build failed!" - } - } + sh "docker build -t ${IMAGE_NAME} ." } } @@ -59,16 +39,10 @@ pipeline { steps { script { try { - // Start Docker container sh "docker run -d --name ${APP_NAME}-test -p 8080:8080 ${IMAGE_NAME}" - sh "sleep 15" // wait for app to start - - // Health check + sh "sleep 15" sh "curl -f http://localhost:8080/actuator/health" - } catch (err) { - error "Docker integration tests failed!" } finally { - // Clean up container sh "docker stop ${APP_NAME}-test || true" sh "docker rm ${APP_NAME}-test || true" } @@ -79,14 +53,10 @@ pipeline { post { success { - script { - githubNotify context: 'Jenkins CI', status: 'SUCCESS' - } + githubNotify context: 'Jenkins CI', status: 'SUCCESS' } failure { - script { - githubNotify context: 'Jenkins CI', status: 'FAILURE' - } + githubNotify context: 'Jenkins CI', status: 'FAILURE' } } }