From f0e9eefacd65a9bf03809addb1fd6f8061bd8ab1 Mon Sep 17 00:00:00 2001 From: hamzaatlili <162675281+hamzaatlili@users.noreply.github.com> Date: Wed, 11 Feb 2026 08:42:03 +0100 Subject: [PATCH] Add Jenkinsfile for backend build and test pipeline --- backend/Jenkinsfile | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 backend/Jenkinsfile diff --git a/backend/Jenkinsfile b/backend/Jenkinsfile new file mode 100644 index 0000000..5180ec5 --- /dev/null +++ b/backend/Jenkinsfile @@ -0,0 +1,48 @@ +pipline{ + agent any + tools { + maven 'Maven' + jdk 'JDK17' + } + environment { + BACKEND_DIR='backend' + } + stages { + stage ('CHECHOUT'){ + steps { + checkout scm + } +} + stage ('Build Backend'){ + steps { + dir("${BACHEND_DIR}"){ + sh 'mvn clean compile' + } + } + } + stage ('Run Tests'){ + steps { + dir("${BACKEND_DIR}"){ + sh 'mvn test' + } + } + } + stage('Package') { + steps { + dir("${BACKEND_DIR}") { + sh 'mvn package -DskipTests' + } + } + } +} + +post { + success { + echo 'Backend Build Successful!' + } + failure { + echo 'Backend Build Failed!' + } +} + +}