-
Notifications
You must be signed in to change notification settings - Fork 31
/
jenkinsfile_release
58 lines (56 loc) · 1.64 KB
/
jenkinsfile_release
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* This pipeline script was created manually based on scripts created by jenkins-build-creator.
*
*/
@Library('integration-pipeline-library@master')
import com.synopsys.integration.Constants
properties(
[
limitBuildsToKeep(),
disableConcurrentBuilds(),
parameters(
[
releaseCheckbox(),
releaseCommitMessage(),
selectBranch('origin/main')
]
)
]
)
pipeline {
agent {
label 'integrations'
}
stages {
stage('Git') {
steps {
gitCheckoutExportVariables('https://github.com/synopsys-sig/detect-action.git')
}
}
stage('Release') {
when {
allOf {
expression { return params.RUN_RELEASE }
not { branch 'main' }
}
}
steps {
withCredentials([usernamePassword(credentialsId: GitStage.DEFAULT_CREDENTIALS_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) {
sh "git branch -u origin/${env.GIT_LOCAL_BRANCH}"
sh "git remote set-url origin https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/synopsys-sig/detect-action.git"
}
sh 'npm ci'
sh "npm version ${env.GIT_LOCAL_BRANCH}"
archiveArtifacts 'dist/*.js*'
}
}
}
post {
failure {
emailFailure(Constants.CENTRAL_INTEGRATIONS_TEAM_EMAIL)
}
fixed {
emailFixed(Constants.CENTRAL_INTEGRATIONS_TEAM_EMAIL)
}
}
}