dev #dev #14696 Перенос WPA приложения кофелайка тест на прод: add git pull to Jenkinsfile

This commit is contained in:
nikolay 2023-07-06 12:10:36 +04:00
parent 97ce3c9e55
commit ee0792b954
2 changed files with 31 additions and 0 deletions

1
Jenkinsfile vendored
View File

@ -10,6 +10,7 @@ node('Palladium'){
}
sh "git checkout ${env.BRANCH_NAME}"
sh "git pull"
}
stage("build and publish"){
dir('angular'){

View File

@ -0,0 +1,30 @@
env.HL_BUILD_MODE = "jenkins"
node('Palladium'){
stage('get new version to repo') {
checkout scm
if (lastCommitIsBumpCommit()) {
currentBuild.result = 'ABORTED'
error('Последний коммит - результат сборки jenkins')
}
//sh "git submodule update --init --recursive"
//sh "git submodule update --remote --merge"
}
stage("build and publish"){
dir('angular'){
sh label: '', script: 'npm i'
sh label: '', script: 'npm run build'
}
}
}
private boolean lastCommitIsBumpCommit() {
lastCommit = sh([script: 'git log -1', returnStdout: true])
if (lastCommit.contains("Author: jenkins")) {
return true
} else {
return false
}
}