forked from microsoft/Recognizers-Text
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from reviewpro/revert-2-standard-pipeline
Revert "integrate new fork pipeline"
- Loading branch information
Showing
1 changed file
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} | ||
|
||
} |