From ee0792b954777a198290ef5e687b81a37f4b619a Mon Sep 17 00:00:00 2001 From: nikolay Date: Thu, 6 Jul 2023 12:10:36 +0400 Subject: [PATCH] =?UTF-8?q?dev=20#dev=20#14696=20=D0=9F=D0=B5=D1=80=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=20WPA=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D1=84=D0=B5=D0=BB=D0=B0?= =?UTF-8?q?=D0=B9=D0=BA=D0=B0=20=D1=82=D0=B5=D1=81=D1=82=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B4:=20add=20git=20pull=20to=20Jenkinsfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 1 + Jenkinsfile.~coffee-like-test~ | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Jenkinsfile.~coffee-like-test~ 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 + } +}