[no publish] simplify ci
This commit is contained in:
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
@ -8,32 +8,15 @@ pipeline {
|
||||
versionPrefix: '1.2.',
|
||||
worstResultForIncrement: 'SUCCESS'
|
||||
])
|
||||
publish = 0
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Setup') {
|
||||
stage('Building') {
|
||||
steps {
|
||||
echo 'Setting up environment'
|
||||
sh 'yarn --frozen-lockfile'
|
||||
sh 'nodejs jenkins.js ${VERSION}'
|
||||
script {
|
||||
currentBuild.displayName = env.VERSION
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
success {
|
||||
script {
|
||||
publish = sh script: "git log -1 | grep '\\[no publish\\]'", returnStatus: true
|
||||
if (publish != 0) {
|
||||
echo 'Deploying'
|
||||
sh 'yarn publish'
|
||||
} else {
|
||||
echo 'Build successful, Commit not marked for deploying'
|
||||
currentBuild.result = "UNSTABLE"
|
||||
}
|
||||
sh 'yarn ci ${VERSION}'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user