From 8767549c03c5941708aea94ab737175e70bdbedc Mon Sep 17 00:00:00 2001 From: segues Date: Mon, 6 Nov 2023 10:06:12 +0100 Subject: [PATCH 1/2] integrate new fork pipeline --- Jenkinsfile | 100 +++------------------------------------------------- 1 file changed, 4 insertions(+), 96 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 77c22b0a9c..14ef84a196 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,98 +1,6 @@ @Library("pipeline-utils@master") -import com.reviewpro.* +def PROJECT_NAME = "Recognizers-Text" +def EMAIL_TO_NOTIFY = "app@shijigroup.com" -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, "pd@reviewpro.com", nextTag) - } - if (params.CLOSE) { - notifierPipelineUtils.notifyClosing(currentBuild, env.BUILD_URL, "pd@reviewpro.com", nextTag) - } - deleteDir() - } - } - failure { - script { - notifierPipelineUtils.notifyError(currentBuild, env.BUILD_URL, "pd@reviewpro.com", nextTag) - } - } - } - -} +forkNodePipeline(projectName: PROJECT_NAME, + emailToNotify: EMAIL_TO_NOTIFY) From 141fbc402e815595f11b60b17493446ae52ac243 Mon Sep 17 00:00:00 2001 From: segues <104765016+segues@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:21:27 +0100 Subject: [PATCH 2/2] Revert "integrate new fork pipeline" --- Jenkinsfile | 100 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 96 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 14ef84a196..77c22b0a9c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,6 +1,98 @@ @Library("pipeline-utils@master") -def PROJECT_NAME = "Recognizers-Text" -def EMAIL_TO_NOTIFY = "app@shijigroup.com" +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, "pd@reviewpro.com", nextTag) + } + if (params.CLOSE) { + notifierPipelineUtils.notifyClosing(currentBuild, env.BUILD_URL, "pd@reviewpro.com", nextTag) + } + deleteDir() + } + } + failure { + script { + notifierPipelineUtils.notifyError(currentBuild, env.BUILD_URL, "pd@reviewpro.com", nextTag) + } + } + } + +}