diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000000000000000000000000000000000000..e66b108bfe8a8b90c49585dc3d5005d817a3ae8d --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,42 @@ +pipeline { + agent any + + environment { + GCR_REGISTRY = "asia.gcr.io/upsmf-368011" + IMAGE_NAME = "examsandadmissions-be-uat" + BRANCH_NAME = "main" + IMAGE_TAG = "1.0" + } + + stages { + stage('Clone Repository') { + steps { + git branch: 'main', url: 'https://github.com/UPHRH-platform/examsAndAdmissions.git' + } + } + + stage('Build Artifact') { + steps { + sh 'mvn clean install -DskipTests' + } + } + + stage('Build Docker Image') { + steps { + script { + def dockerTag = "${IMAGE_TAG}-${env.BUILD_NUMBER}" + def dockerImage = docker.build("${GCR_REGISTRY}/${IMAGE_NAME}:${dockerTag}") + } + } + } + stage('Push to GCR') { + steps { + script { + def dockerTag = "${IMAGE_TAG}-${env.BUILD_NUMBER}" + sh "docker push ${GCR_REGISTRY}/${IMAGE_NAME}:${dockerTag}" + } + } + } + + } +}