Update Jenkinsfile

Signed-off-by: prankumargrid <prankumar@griddynamics.com>
This commit is contained in:
prankumargrid 2025-04-29 12:20:05 +05:30 committed by GitHub
parent 8d18fa01dd
commit 00e590de05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

12
Jenkinsfile vendored
View file

@ -8,7 +8,6 @@ pipeline {
stages {
stage('Check Branch') {
steps {
script {
if (env.BRANCH_NAME == 'main') {
currentBuild.description = "Main branch build"
@ -20,12 +19,10 @@ pipeline {
}
}
}
}
}
def buildMainPipeline() {
stage('Docker Build and Push') {
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'docker-hub-credentials-id') {
def app = docker.build("${env.REGISTRY}/main:${env.IMAGE_TAG}")
@ -33,31 +30,23 @@ def buildMainPipeline() {
}
}
}
}
}
def buildMRPipeline() {
stage('Checkstyle') {
steps {
sh 'gradle checkstyleMain checkstyleTest'
archiveArtifacts artifacts: '**/build/reports/checkstyle/*.xml', allowEmptyArchive: true
}
}
stage('Test') {
steps {
sh 'gradle test'
}
}
stage('Build (No Tests)') {
steps {
sh 'gradle build -x test'
}
}
stage('Docker Build and Push') {
steps {
script {
docker.withRegistry('https://index.docker.io/v1/', 'docker-hub-credentials-id') {
def app = docker.build("${env.REGISTRY}/mr:${env.IMAGE_TAG}")
@ -65,7 +54,6 @@ def buildMRPipeline() {
}
}
}
}
}