diff --git a/Jenkinsfile b/Jenkinsfile index 127ebc5..4f1e41c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,6 +10,7 @@ node('Palladium'){ } sh "git checkout ${env.BRANCH_NAME}" + sh "git pull" } stage("build and publish"){ dir('angular'){ diff --git a/Jenkinsfile.~coffee-like-test~ b/Jenkinsfile.~coffee-like-test~ new file mode 100644 index 0000000..9c1186f --- /dev/null +++ b/Jenkinsfile.~coffee-like-test~ @@ -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 + } +}