Skip to content

Commit

Permalink
Merge pull request #3 from reviewpro/revert-2-standard-pipeline
Browse files Browse the repository at this point in the history
Revert "integrate new fork pipeline"
  • Loading branch information
segues authored Nov 6, 2023
2 parents c804478 + 141fbc4 commit 20c1fbc
Showing 1 changed file with 96 additions and 4 deletions.
100 changes: 96 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,98 @@
@Library("pipeline-utils@master")
def PROJECT_NAME = "Recognizers-Text"
def EMAIL_TO_NOTIFY = "[email protected]"
import com.reviewpro.*

forkNodePipeline(projectName: PROJECT_NAME,
emailToNotify: EMAIL_TO_NOTIFY)
gitPipelineUtils = new gitUtils()
mavenPipelineUtils = new mavenUtils()
tagPipelineUtils = new tagUtils()
rundeckPipelineUtils = new rundeckUtils()
notifierPipelineUtils = new notifierUtils()
dependencyCheckPipelineUtils = new dependencyCheckUtils()
sonarOwasp = new sonarqubeUtils()

def nextTag = ''

pipeline {
agent any

environment {
CODEARTIFACT_AUTH_TOKEN = sh(script: "aws codeartifact get-authorization-token --domain reviewpro --domain-owner 864066779100 --region eu-central-1 --query authorizationToken --output text", returnStdout: true).trim()
}

options {
disableConcurrentBuilds()
skipDefaultCheckout()
skipStagesAfterUnstable()
}

stages {

stage ('Checkout') {
steps {
checkout scm
script {
gitPipelineUtils.gitCheckout(env.BRANCH_NAME)
nextTag = tagPipelineUtils.getNextReleaseTag()
}
}
}

stage ('Build') {
steps {
dir ("Java") {
sh 'mvn -U clean compile'
}
}
}

stage ('Publish') {
when {
branch 'master'
}
steps {
dir ("Java") {
script {
mavenPipelineUtils.publish(nextTag)
}
}
}
}

stage ('Hotfix') {
when {
allOf {
branch "hotfix-*"
expression {
env.BRANCH_NAME ==~ '^hotfix-[0-9]+\\.[0-9]+\\.[0-9]+\$'
}
}
}
steps {
dir ("Java") {
script {
mavenPipelineUtils.publishHotfix(env.BRANCH_NAME)
}
}
}
}
}

post {
success {
script {
if (currentBuild.previousBuild != null && currentBuild.previousBuild.result != 'SUCCESS') {
notifierPipelineUtils.notifySuccess(currentBuild, env.BUILD_URL, "[email protected]", nextTag)
}
if (params.CLOSE) {
notifierPipelineUtils.notifyClosing(currentBuild, env.BUILD_URL, "[email protected]", nextTag)
}
deleteDir()
}
}
failure {
script {
notifierPipelineUtils.notifyError(currentBuild, env.BUILD_URL, "[email protected]", nextTag)
}
}
}

}

0 comments on commit 20c1fbc

Please sign in to comment.