[no publish] simplify ci
This commit is contained in:
26
Jenkinsfile
vendored
26
Jenkinsfile
vendored
@ -12,34 +12,12 @@ pipeline {
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Setup') {
|
||||
stage('Building') {
|
||||
steps {
|
||||
echo 'Setting up test environment'
|
||||
sh 'yarn --frozen-lockfile'
|
||||
sh 'nodejs jenkins.js ${VERSION}'
|
||||
script {
|
||||
currentBuild.displayName = env.VERSION
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Testing') {
|
||||
steps {
|
||||
echo 'Running tests...'
|
||||
sh 'npm test'
|
||||
}
|
||||
}
|
||||
}
|
||||
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