From 55486de524f861f93bdc2d8c8feee7c5e1b6b055 Mon Sep 17 00:00:00 2001 From: gofnnp Date: Tue, 27 Sep 2022 22:53:36 +0400 Subject: [PATCH 01/11] dev #12738 --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d18d1f..320f9ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ node('Rubidium'){ // } dir('/opt/usersite-build'){ - sh label: '', script: 'npm i' + // sh label: '', script: 'npm i' // sh label: '', script: 'npm run build' sh label: '', script: 'ng build' } From 8b6af5fa2150292888be66509b0ce939ba267469 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:25:16 +0400 Subject: [PATCH 02/11] build commit --- Jenkinsfile | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 320f9ae..2caa9ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,27 +1,21 @@ env.HL_BUILD_MODE = "jenkins" -node('Rubidium'){ +node('Lithium'){ stage('get new version to repo') { - dir('/opt/usersite-build'){ - checkout([$class: 'GitSCM', branches: [[name: '*/fashion-logica']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins_all', url: 'https://git.hlcompany.ru/git/usersite.git']]]) + checkout scm + if (lastCommitIsBumpCommit()) { + currentBuild.result = 'ABORTED' + error('Последний коммит - результат сборки jenkins') } + bat "git checkout ${env.BRANCH_NAME}" + bat "git checkout -- ." + bat "git pull" + bat "git submodule update --init --recursive" + bat "git submodule update --remote --merge" } - - stage('build project') { - // sh label: '', script: 'systemctl stop lkcrm4retail' - // dir('/opt/SynthVisionBox/node'){ - // sh label: '', script: 'npm install --only=prod' - // sh label: '', script: 'node db_updater.js' - // } - - dir('/opt/usersite-build'){ - // sh label: '', script: 'npm i' - // sh label: '', script: 'npm run build' - sh label: '', script: 'ng build' - } - - // sh label: '', script: 'systemctl start lkcrm4retail' + stage("build and publish"){ + sh label: '', script: 'npm i' + sh label: '', script: 'npm run build' } - } \ No newline at end of file From 7a490e4599922dd1dc35f045217797d7001d669c Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:25:53 +0400 Subject: [PATCH 03/11] build commit --- angular.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular.json b/angular.json index 7bbfa77..7ccc886 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "/var/www/fashion-logica", + "outputPath": "/var/www/html/lk.crm4retail.ru", "baseHref": "/", "index": "src/index.html", "main": "src/main.ts", From 06e0b8efe1679a80131a6157464f325d884f3fb1 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:27:33 +0400 Subject: [PATCH 04/11] rebuild commit --- Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2caa9ea..cb6d1c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,4 +18,17 @@ node('Lithium'){ sh label: '', script: 'npm i' sh label: '', script: 'npm run build' } -} \ No newline at end of file +} +def cmd(command) { + // при запуске Jenkins не в режиме UTF-8 нужно написать chcp 1251 вместо chcp 65001 + if (isUnix()) { sh "${command}" } else { bat "chcp 65001\n${command}"} +} + +private boolean lastCommitIsBumpCommit() { + lastCommit = bat([script: 'git log -1', returnStdout: true]) + if (lastCommit.contains("Author: jenkins")) { + return true + } else { + return false + } +} From ba71eee97ff627e00f78d32aa0565175cf35e491 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:28:29 +0400 Subject: [PATCH 05/11] rebuild commit --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb6d1c2..021bafe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,11 +8,11 @@ node('Lithium'){ currentBuild.result = 'ABORTED' error('Последний коммит - результат сборки jenkins') } - bat "git checkout ${env.BRANCH_NAME}" - bat "git checkout -- ." - bat "git pull" - bat "git submodule update --init --recursive" - bat "git submodule update --remote --merge" + cmd "git checkout ${env.BRANCH_NAME}" + cmd "git checkout -- ." + cmd "git pull" + cmd "git submodule update --init --recursive" + cmd "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' From 615f7086004032d97848c32c3c2009538abcb56e Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:29:32 +0400 Subject: [PATCH 06/11] rebuild commit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 021bafe..0fc020c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ def cmd(command) { } private boolean lastCommitIsBumpCommit() { - lastCommit = bat([script: 'git log -1', returnStdout: true]) + lastCommit = cmd([script: 'git log -1', returnStdout: true]) if (lastCommit.contains("Author: jenkins")) { return true } else { From 5b9be577e76634ebe9572462755bfd2ab6347b81 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:34:31 +0400 Subject: [PATCH 07/11] rebuild commit --- Jenkinsfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0fc020c..6c72135 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,24 +8,20 @@ node('Lithium'){ currentBuild.result = 'ABORTED' error('Последний коммит - результат сборки jenkins') } - cmd "git checkout ${env.BRANCH_NAME}" - cmd "git checkout -- ." - cmd "git pull" - cmd "git submodule update --init --recursive" - cmd "git submodule update --remote --merge" + sh "git checkout ${env.BRANCH_NAME}" + sh "git checkout -- ." + sh "git pull" + sh "git submodule update --init --recursive" + sh "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' sh label: '', script: 'npm run build' } } -def cmd(command) { - // при запуске Jenkins не в режиме UTF-8 нужно написать chcp 1251 вместо chcp 65001 - if (isUnix()) { sh "${command}" } else { bat "chcp 65001\n${command}"} -} private boolean lastCommitIsBumpCommit() { - lastCommit = cmd([script: 'git log -1', returnStdout: true]) + lastCommit = sh([script: 'git log -1', returnStdout: true]) if (lastCommit.contains("Author: jenkins")) { return true } else { From 988a05e94d9ce561c556775d065e130ddcf4cb9f Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:35:27 +0400 Subject: [PATCH 08/11] rebuild commit --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6c72135..9ad1162 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,10 @@ node('Lithium'){ } sh "git checkout ${env.BRANCH_NAME}" sh "git checkout -- ." - sh "git pull" - sh "git submodule update --init --recursive" - sh "git submodule update --remote --merge" + + //sh "git pull" + //sh "git submodule update --init --recursive" + //sh "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' From ff0f8d6fad02e7c73af5edae0409dbddddcbad84 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:54:07 +0400 Subject: [PATCH 09/11] rebuild --- angular.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular.json b/angular.json index 7ccc886..5e88681 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "/var/www/html/lk.crm4retail.ru", + "outputPath": "/var/www/html/lk.crm4retail.ru/fashion-logica", "baseHref": "/", "index": "src/index.html", "main": "src/main.ts", From 34080a0ee0542581fba765e8898505b0f0a5bac1 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:58:06 +0400 Subject: [PATCH 10/11] build commit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9ad1162..9a5a622 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ node('Lithium'){ sh "git checkout ${env.BRANCH_NAME}" sh "git checkout -- ." - //sh "git pull" + sh "git pull" //sh "git submodule update --init --recursive" //sh "git submodule update --remote --merge" } From 9b64746c2ec94efe4ec91f9b86c4bd1016a27b7f Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 15:07:39 +0400 Subject: [PATCH 11/11] test commit --- angular.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/angular.json b/angular.json index 5e88681..ea8448c 100644 --- a/angular.json +++ b/angular.json @@ -1,4 +1,5 @@ { + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", @@ -10,6 +11,7 @@ "style": "scss" } }, + "root": "", "sourceRoot": "src", "prefix": "app",