From 8073420970773a084f2277544dd80114df854da9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 10:39:37 +0000 Subject: [PATCH 01/24] add README --- README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 From 744ee5f3d0d0fb0b9e873fba5c3e72105c962266 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 10:50:17 +0000 Subject: [PATCH 02/24] GIS-1621 - Add first jenkins groovy script --- ScriptTest/script_test_1.gsh | 75 ++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 ScriptTest/script_test_1.gsh diff --git a/ScriptTest/script_test_1.gsh b/ScriptTest/script_test_1.gsh new file mode 100644 index 0000000..6b3e988 --- /dev/null +++ b/ScriptTest/script_test_1.gsh @@ -0,0 +1,75 @@ +pipeline { + // agent { label 'Pemba' } + // agent { label 'floreana' } + agent { label 'tiger' } + // agent any + + stages { + stage('Checkout') { + steps { + checkout([$class: 'GitSCM', + branches: [[name: 'refs/heads/master']], + doGenerateSubmoduleConfigurations: false, + extensions: [[$class: 'RelativeTargetDirectory', + relativeTargetDir: 'arepo'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 60], + [$class: 'CleanBeforeCheckout'], + [$class: 'CheckoutOption', timeout: 60]], + submoduleCfg: [], + userRemoteConfigs: [[url: 'git@hydra:danhawkins/testproject.git']]]) + script { + if (isUnix()) { + sh 'echo $WORKSPACE' + sh 'ls -lsR $WORKSPACE' + } + else { + bat 'echo %WORKSPACE%' + bat 'dir "%WORKSPACE%"' + } + } + } + } + stage('Build') { + steps { + script { + if (isUnix()) { + sh 'echo make $APARAMETER' + sh 'echo $WORKSPACE' + sh 'cat $WORKSPACE/arepo/README2.md' + } + else { + bat 'echo make "%APARAMETER%"' + bat 'echo %WORKSPACE%' + bat 'type "%WORKSPACE%\\arepo\\README2.md"' + } + } + } + } + stage('Test'){ + steps { + script { + if (isUnix()) { + sh 'echo make check' + sh 'echo do test' + } + else { + bat 'echo make check' + bat 'echo do test' + } + } + } + } + stage('Deploy') { + steps { + script { + if (isUnix()) { + sh 'echo make publish' + } + else { + bat 'echo make publish' + } + } + } + } + } +} From 8d0a7bbd170fef8f97021fa24b6ee7c307effa49 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 17:22:37 +0000 Subject: [PATCH 03/24] GIS-1621 - Now working --- ScriptTest/script_test_1.gsh | 75 ------------ build/build.gsh | 222 +++++++++++++++++++++++++++++++++++ 2 files changed, 222 insertions(+), 75 deletions(-) delete mode 100644 ScriptTest/script_test_1.gsh create mode 100644 build/build.gsh diff --git a/ScriptTest/script_test_1.gsh b/ScriptTest/script_test_1.gsh deleted file mode 100644 index 6b3e988..0000000 --- a/ScriptTest/script_test_1.gsh +++ /dev/null @@ -1,75 +0,0 @@ -pipeline { - // agent { label 'Pemba' } - // agent { label 'floreana' } - agent { label 'tiger' } - // agent any - - stages { - stage('Checkout') { - steps { - checkout([$class: 'GitSCM', - branches: [[name: 'refs/heads/master']], - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'RelativeTargetDirectory', - relativeTargetDir: 'arepo'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false, timeout: 60], - [$class: 'CleanBeforeCheckout'], - [$class: 'CheckoutOption', timeout: 60]], - submoduleCfg: [], - userRemoteConfigs: [[url: 'git@hydra:danhawkins/testproject.git']]]) - script { - if (isUnix()) { - sh 'echo $WORKSPACE' - sh 'ls -lsR $WORKSPACE' - } - else { - bat 'echo %WORKSPACE%' - bat 'dir "%WORKSPACE%"' - } - } - } - } - stage('Build') { - steps { - script { - if (isUnix()) { - sh 'echo make $APARAMETER' - sh 'echo $WORKSPACE' - sh 'cat $WORKSPACE/arepo/README2.md' - } - else { - bat 'echo make "%APARAMETER%"' - bat 'echo %WORKSPACE%' - bat 'type "%WORKSPACE%\\arepo\\README2.md"' - } - } - } - } - stage('Test'){ - steps { - script { - if (isUnix()) { - sh 'echo make check' - sh 'echo do test' - } - else { - bat 'echo make check' - bat 'echo do test' - } - } - } - } - stage('Deploy') { - steps { - script { - if (isUnix()) { - sh 'echo make publish' - } - else { - bat 'echo make publish' - } - } - } - } - } -} diff --git a/build/build.gsh b/build/build.gsh new file mode 100644 index 0000000..500f20b --- /dev/null +++ b/build/build.gsh @@ -0,0 +1,222 @@ +pipeline { + // agent { label 'Pemba' } + // agent { label 'floreana' } + agent { label 'build' } + // agent any + stages { + stage('Checkout source') { + steps { + checkout([$class: 'GitSCM', + branches: [ + [name: 'origin/${BRANCH_NAME}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/newsw', shallow: false, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'GitRepository'], + [$class: 'PathRestriction', excludedRegions: '', includedRegions: '''src/.* autobuild/.*'''] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/newsw.git'] + ] + ]) + } + } + stage('Checkout dependencies') { + steps { + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/samba_fw_releases', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'samba_fw'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/samba_fw_releases.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'xr1003_el'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:releases/HMB_XR_1003_Embeddded_Logic.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'refs/tags/${VERSION_STAMPING_VERSION}'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\ver_stamping_releases', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'ver_stamping'] + ], + submoduleCfg: [], + userRemoteConfigs: [ + [url: 'git@hydra:releases/ver_stamping_releases.git'] + ] + ]) + checkout([$class: 'GitSCM', + branches: [ + [name: 'origin/master'] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\print_release_difference', shallow: true, timeout: 60], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: 'print_release_difference'] + ], + submoduleCfg: [ + ], + userRemoteConfigs: [ + [url: 'git@hydra:gis/print_release_difference.git'] + ] + ]) + + } + } + stage('Setup links') { + steps { + bat ''' + @echo on' + rmdir jobscripts + mklink /J jobscripts GitRepository\\autobuild\\build + rmdir jobscripts_common + mklink /J jobscripts_common "GitRepository\\autobuild\\common" + rmdir security + mklink /J security "GitRepository\\autobuild\\security" + rmdir src + mklink /J src GitRepository\\src + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Imports and exports') { + steps { + bat ''' + call jobscripts\\reset_imports_and_exports.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Clean') { + steps { + bat ''' + call jobscripts\\clean.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Generating version number') { + steps { + bat ''' + call jobscripts\\versioning.bat + if errorlevel 1 exit /b 1 + ''' + script { + env.BUILD_STAMP = readFile('version/buildstamp.txt').trim() + env.SRC_REVISION = readFile('version/revision.txt').trim() + } + } + } + stage('Generating version differences lists') { + steps { + bat ''' + set CURRENT_RELEASE=origin/%BRANCH_NAME% + set PREVIOUS_RELEASE=%PREVIOUS_RELEASE_BRANCH_NAME% + set WORKING_PATH=%WORKSPACE%/GitRepository + set DIFFERENCE_OPTIONS="opposite notcommon" + "%PYTHON34%" "%WORKSPACE%/print_release_difference/show_release_differences.py" > "%WORKSPACE%\\version\\differences.txt" + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Inherit version imports') { + steps { + bat ''' + call jobscripts\\version_imports.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Version stamp files') { + steps { + bat ''' + call jobscripts\\versionrcfiles.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Compile') { + steps { + bat ''' + call jobscripts\\autobuild.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Make SDK source') { + steps { + bat ''' + call jobscripts\\make_src_sdk.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Build SDK source') { + steps { + bat ''' + call jobscripts\\build_sdk.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Prepare exports') { + steps { + bat ''' + call jobscripts\\export.bat + if errorlevel 1 exit /b 1 + ''' + } + } + stage('Scan for warnings') { + steps { + warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'MSBuild']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: '' + } + } + stage('Archiving artifacts') { + steps { + archiveArtifacts 'bin/**,scripts/**,version/**,pipeline/**,sdk_source/**,sdk_source_tree_built.txt,ildasm/**' + } + } + } + post { + success { + echo 'Succeeded build' + } + } +} + From 43beb78946205895782c057a1fb3ca7cb02d05a1 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 11 Nov 2017 17:42:40 +0000 Subject: [PATCH 04/24] GIS-1621 - Try to parse output --- build/build.gsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build/build.gsh b/build/build.gsh index 500f20b..ffc9773 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -217,6 +217,9 @@ pipeline { success { echo 'Succeeded build' } + always { + step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } } } From 9814e14fb56a609bccaeaa3ee7e4b078153af419 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 09:54:04 +0000 Subject: [PATCH 05/24] GIS-1621 - Try to parse output --- build/build.gsh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index ffc9773..8e49430 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -214,12 +214,13 @@ pipeline { } } post { - success { + always { + echo 'Post-build' + //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } + success { echo 'Succeeded build' } - always { - step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) - } - } + } } From 4b7d20c01db5e2d5af7607d5cf7535c34e30a0bd Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 10:17:37 +0000 Subject: [PATCH 06/24] GIS-1621 - Try to parse output --- build/build.gsh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 8e49430..499af4c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -218,8 +218,19 @@ pipeline { echo 'Post-build' //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) } - success { - echo 'Succeeded build' + success { + echo 'Succeeded build' + build job: '2.0.x_test', + parameters: [ + string(name: 'TEST_PORT', value: '2016'), + booleanParam(name: 'PIPELINE_NO_TEST', value: false), + booleanParam(name: 'USING_GIT', value: true), + string(name: 'REPEAT_COUNT', value: '0'), + booleanParam(name: 'QUICK_TEST', value: true), + booleanParam(name: 'LIST_TESTS', value: false), + string(name: 'BRANCH', value: 'master') + ], + propagate: false } } } From e84879a84501c56ed7c3e8acbfc5ad0efb5af4e3 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:09:03 +0000 Subject: [PATCH 07/24] GIS-1621 - Try to parse output --- build/build.gsh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 499af4c..3781d3c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -204,7 +204,18 @@ pipeline { } stage('Scan for warnings') { steps { - warnings canComputeNew: false, canResolveRelativePaths: false, categoriesPattern: '', consoleParsers: [[parserName: 'MSBuild']], defaultEncoding: '', excludePattern: '', healthy: '', includePattern: '', messagesPattern: '', unHealthy: '' + warnings canComputeNew: false, + canResolveRelativePaths: false, + categoriesPattern: '', + consoleParsers: [ + [parserName: 'MSBuild'] + ], + defaultEncoding: '', + excludePattern: '', + healthy: '', + includePattern: '', + messagesPattern: '', + unHealthy: '' } } stage('Archiving artifacts') { @@ -216,11 +227,13 @@ pipeline { post { always { echo 'Post-build' - //step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + } + failure { + step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) } success { echo 'Succeeded build' - build job: '2.0.x_test', + build job: '${BRANCH_NAME}_test', parameters: [ string(name: 'TEST_PORT', value: '2016'), booleanParam(name: 'PIPELINE_NO_TEST', value: false), From 60127bfce18e7379930e07fa686996b77c8c1a76 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:10:54 +0000 Subject: [PATCH 08/24] GIS-1621 - Try to parse output --- build/build.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.gsh b/build/build.gsh index 3781d3c..8065b13 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -243,7 +243,7 @@ pipeline { booleanParam(name: 'LIST_TESTS', value: false), string(name: 'BRANCH', value: 'master') ], - propagate: false + propagate: true } } } From dafdaa9a08e43a9d5368fbd13faa22f4ff32c987 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 15:44:17 +0000 Subject: [PATCH 09/24] GIS-1621 - Expand variables properly; Format script --- build/build.gsh | 99 +++++++++++++++++++++++++++++++++++++------------ 1 file changed, 76 insertions(+), 23 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 8065b13..922899c 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -8,15 +8,28 @@ pipeline { steps { checkout([$class: 'GitSCM', branches: [ - [name: 'origin/${BRANCH_NAME}'] + [name: "origin/${BRANCH_NAME}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/newsw', shallow: false, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'GitRepository'], - [$class: 'PathRestriction', excludedRegions: '', includedRegions: '''src/.* autobuild/.*'''] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'GitRepository' + ], + [$class: 'PathRestriction', + excludedRegions: '', + includedRegions: '''src/.* autobuild/.*''' + ] ], submoduleCfg: [ ], @@ -30,14 +43,24 @@ pipeline { steps { checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}'] + [name: "refs/tags/${FD1200_FIRMWARE_RELEASE_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/samba_fw_releases', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'samba_fw'] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/samba_fw_releases", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'samba_fw' + ] ], submoduleCfg: [ ], @@ -47,14 +70,24 @@ pipeline { ]) checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}'] + [name: "refs/tags/${XR_1003_EMBEDDED_LOGIC_RELEASE_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: 0, noTags: false, reference: '${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'xr1003_el'] + [$class: 'CloneOption', + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'xr1003_el' + ] ], submoduleCfg: [ ], @@ -64,14 +97,23 @@ pipeline { ]) checkout([$class: 'GitSCM', branches: [ - [name: 'refs/tags/${VERSION_STAMPING_VERSION}'] + [name: "refs/tags/${VERSION_STAMPING_VERSION}"] ], doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\ver_stamping_releases', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'ver_stamping'] + [$class: 'CloneOption', + noTags: false, + reference: "${REPO_ROOT}/ver_stamping_releases", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'ver_stamping' + ] ], submoduleCfg: [], userRemoteConfigs: [ @@ -85,9 +127,18 @@ pipeline { doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', noTags: false, reference: '${REPO_ROOT}\\print_release_difference', shallow: true, timeout: 60], - [$class: 'CheckoutOption', timeout: 60], - [$class: 'RelativeTargetDirectory', relativeTargetDir: 'print_release_difference'] + [$class: 'CloneOption', + noTags: false, + reference: "${REPO_ROOT}/print_release_difference", + shallow: true, + timeout: 60 + ], + [$class: 'CheckoutOption', + timeout: 60 + ], + [$class: 'RelativeTargetDirectory', + relativeTargetDir: 'print_release_difference' + ] ], submoduleCfg: [ ], @@ -229,11 +280,14 @@ pipeline { echo 'Post-build' } failure { - step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true]) + step([$class: 'LogParserPublisher', + parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', + useProjectRule: true + ]) } success { echo 'Succeeded build' - build job: '${BRANCH_NAME}_test', + build job: "${BRANCH_NAME}_test", parameters: [ string(name: 'TEST_PORT', value: '2016'), booleanParam(name: 'PIPELINE_NO_TEST', value: false), @@ -247,4 +301,3 @@ pipeline { } } } - From b86e13a3690e13d90d451a683d1ed8ef5ca42d8d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 12 Nov 2017 16:06:51 +0000 Subject: [PATCH 10/24] GIS-1621 - Don't trigger subsequent builds; Let them trigger of this build --- build/build.gsh | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index 922899c..e284106 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -280,6 +280,7 @@ pipeline { echo 'Post-build' } failure { + echo 'Failed build' step([$class: 'LogParserPublisher', parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', useProjectRule: true @@ -287,17 +288,6 @@ pipeline { } success { echo 'Succeeded build' - build job: "${BRANCH_NAME}_test", - parameters: [ - string(name: 'TEST_PORT', value: '2016'), - booleanParam(name: 'PIPELINE_NO_TEST', value: false), - booleanParam(name: 'USING_GIT', value: true), - string(name: 'REPEAT_COUNT', value: '0'), - booleanParam(name: 'QUICK_TEST', value: true), - booleanParam(name: 'LIST_TESTS', value: false), - string(name: 'BRANCH', value: 'master') - ], - propagate: true } } } From c62d2d3096fe786680a89f3f0d92b0689bb48515 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 16:51:58 +0000 Subject: [PATCH 11/24] Put a newline in the git included regions filter --- build/build.gsh | 141 ++++++++++++++++++++++++------------------------ 1 file changed, 71 insertions(+), 70 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index e284106..a398a96 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -14,22 +14,23 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/newsw", - shallow: false, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'GitRepository' - ], + relativeTargetDir: 'GitRepository' + ], [$class: 'PathRestriction', - excludedRegions: '', - includedRegions: '''src/.* autobuild/.*''' - ] + excludedRegions: '', + includedRegions: '''src/.* + autobuild/.*''' + ] ], submoduleCfg: [ ], @@ -49,18 +50,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/samba_fw_releases", - shallow: true, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/samba_fw_releases", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'samba_fw' - ] + relativeTargetDir: 'samba_fw' + ] ], submoduleCfg: [ ], @@ -76,18 +77,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", - shallow: true, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/HMB_XR_1003_Embeddded_Logic.git", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'xr1003_el' - ] + relativeTargetDir: 'xr1003_el' + ] ], submoduleCfg: [ ], @@ -103,17 +104,17 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - noTags: false, - reference: "${REPO_ROOT}/ver_stamping_releases", - shallow: true, - timeout: 60 - ], + noTags: false, + reference: "${REPO_ROOT}/ver_stamping_releases", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'ver_stamping' - ] + relativeTargetDir: 'ver_stamping' + ] ], submoduleCfg: [], userRemoteConfigs: [ @@ -128,17 +129,17 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - noTags: false, - reference: "${REPO_ROOT}/print_release_difference", - shallow: true, - timeout: 60 - ], + noTags: false, + reference: "${REPO_ROOT}/print_release_difference", + shallow: true, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'print_release_difference' - ] + relativeTargetDir: 'print_release_difference' + ] ], submoduleCfg: [ ], @@ -256,17 +257,17 @@ pipeline { stage('Scan for warnings') { steps { warnings canComputeNew: false, - canResolveRelativePaths: false, - categoriesPattern: '', - consoleParsers: [ - [parserName: 'MSBuild'] - ], - defaultEncoding: '', - excludePattern: '', - healthy: '', - includePattern: '', - messagesPattern: '', - unHealthy: '' + canResolveRelativePaths: false, + categoriesPattern: '', + consoleParsers: [ + [parserName: 'MSBuild'] + ], + defaultEncoding: '', + excludePattern: '', + healthy: '', + includePattern: '', + messagesPattern: '', + unHealthy: '' } } stage('Archiving artifacts') { @@ -276,16 +277,16 @@ pipeline { } } post { - always { + always { echo 'Post-build' - } - failure { + } + failure { echo 'Failed build' - step([$class: 'LogParserPublisher', - parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', - useProjectRule: true - ]) - } + step([$class: 'LogParserPublisher', + parsingRulesPath: 'GitRepository/autobuild/build/log parsing rules/vs.txt', + useProjectRule: true + ]) + } success { echo 'Succeeded build' } From 3f2f2851681b8aa77c4cac08e1dd5593ec6e4ab7 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 17:04:43 +0000 Subject: [PATCH 12/24] Directory filtering doesn't seem to be working - resulting in no build triggers - so removing it --- build/build.gsh | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/build/build.gsh b/build/build.gsh index a398a96..1051f40 100644 --- a/build/build.gsh +++ b/build/build.gsh @@ -14,23 +14,18 @@ pipeline { extensions: [ [$class: 'CleanBeforeCheckout'], [$class: 'CloneOption', - depth: 0, - noTags: false, - reference: "${REPO_ROOT}/newsw", - shallow: false, - timeout: 60 - ], + depth: 0, + noTags: false, + reference: "${REPO_ROOT}/newsw", + shallow: false, + timeout: 60 + ], [$class: 'CheckoutOption', - timeout: 60 - ], + timeout: 60 + ], [$class: 'RelativeTargetDirectory', - relativeTargetDir: 'GitRepository' - ], - [$class: 'PathRestriction', - excludedRegions: '', - includedRegions: '''src/.* - autobuild/.*''' - ] + relativeTargetDir: 'GitRepository' + ], ], submoduleCfg: [ ], From 70b23d7049b5a986935164e72e506d17c7de1903 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:03:14 +0000 Subject: [PATCH 13/24] Move commonly used methods out to Common_scripts --- commandline/commandline.gsh | 12 ++++++++ configuration/configuration.gsh | 34 +++++++++++++++++++++ versioncontrol/git.gsh | 53 +++++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+) create mode 100644 commandline/commandline.gsh create mode 100644 configuration/configuration.gsh create mode 100644 versioncontrol/git.gsh diff --git a/commandline/commandline.gsh b/commandline/commandline.gsh new file mode 100644 index 0000000..c03add7 --- /dev/null +++ b/commandline/commandline.gsh @@ -0,0 +1,12 @@ +String getCommandOutput(String cmd) { + if (isUnix()) { + return sh(returnStdout: true, script: '#!/bin/sh -e\n' + cmd).trim() + } else { + return bat(returnStdout: true, script: """ + @echo off + ${cmd} + """ + ).trim() + } +} + diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh new file mode 100644 index 0000000..424765e --- /dev/null +++ b/configuration/configuration.gsh @@ -0,0 +1,34 @@ +def githelper = load("Common_scripts/versioncontrol/git.gsh") + +configurationCollection = [:] + +def registerConfigurationInfo(String configurationName, String configurationURL, String configurationVersion, String configurationSHA) { + def ConfigurationInfo = [configurationURL, configurationVersion, configurationSHA] + configurationCollection.put(configurationName, ConfigurationInfo) +} + +def registerPipelineScriptConfiguration() { + registerConfigurationInfo('pipeline script', '-', '-', getGitInfo("${WORKSPACE}")) +} + +def saveConfigurationInVersionInfo() { + dir("${WORKSPACE}\\version") { + writeFile file: 'configuration.txt', text: getFormattedConfiguration() + } +} + +String getFormattedConfiguration() { + String formattedInfo = "" + def keys = configurationCollection.keySet().sort() + for (key in keys) { + (configurationURL, configurationVersion, configurationSHA) = configurationCollection.get(key) + formattedLine = String.format("%s:%s,%s,%s%n", key, configurationURL, configurationVersion, configurationSHA) + formattedInfo += formattedLine + } + return formattedInfo +} + +def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + githelper.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) + registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) +} diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh new file mode 100644 index 0000000..1f6d88e --- /dev/null +++ b/versioncontrol/git.gsh @@ -0,0 +1,53 @@ +def commandlinehelper = load("Common_scripts/commandline/commandline.gsh") + +String getGitInfo(String workingSetRootPath) { + dir(workingSetRootPath) { + return commandlinehelper.getCommandOutput('git log -1 --format=oneline') + } +} + +def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + checkout([ + $class: 'GitSCM', + userRemoteConfigs: [ + [url: gitURL] + ], + branches: [ + [name: revision] + ], + doGenerateSubmoduleConfigurations: false, + extensions: [ + [$class: 'CleanBeforeCheckout'], + [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: "${REPO_ROOT}/${repoRoot}", shallow: shallowClone, timeout: 120], + [$class: 'CheckoutOption', timeout: 60], + [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir] + ], + submoduleCfg: [], + ]) +} + +String getSHAFromVersion(String versionFolder) { + dir (versionFolder) { + srcRevision = readFile("gitrevision.txt").trim() + } + return srcRevision +} + +boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { + def keys = versions.keySet() + if (keys.size() <= 1) { + return false + } else { + version = "" + for (key in keys) { + nextversion = versions.get(key) + if (version == "") { + version = nextversion + } + if (nextversion != version) { + return false + } + } + } + return true +} From ca2db55d2bb2a292e1bc070eceff75f6c4721174 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:16:02 +0000 Subject: [PATCH 14/24] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 4 ++-- versioncontrol/git.gsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 424765e..1f86c42 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -1,4 +1,4 @@ -def githelper = load("Common_scripts/versioncontrol/git.gsh") +def gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") configurationCollection = [:] @@ -29,6 +29,6 @@ String getFormattedConfiguration() { } def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { - githelper.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) + gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) } diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 1f6d88e..90dc7ee 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -1,8 +1,8 @@ -def commandlinehelper = load("Common_scripts/commandline/commandline.gsh") +def clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") String getGitInfo(String workingSetRootPath) { dir(workingSetRootPath) { - return commandlinehelper.getCommandOutput('git log -1 --format=oneline') + return clh.getCommandOutput('git log -1 --format=oneline') } } From 1e0f22ed5e86d8e0765b764c7cedea1522280c98 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:19:29 +0000 Subject: [PATCH 15/24] Move commonly used methods out to Common_scripts --- commandline/commandline.gsh | 1 + 1 file changed, 1 insertion(+) diff --git a/commandline/commandline.gsh b/commandline/commandline.gsh index c03add7..df99a75 100644 --- a/commandline/commandline.gsh +++ b/commandline/commandline.gsh @@ -10,3 +10,4 @@ String getCommandOutput(String cmd) { } } +return this \ No newline at end of file From 4c6372bb8c06143a4a017e02368a40cfd53eb03c Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:22:49 +0000 Subject: [PATCH 16/24] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 2 ++ versioncontrol/git.gsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 1f86c42..aa732e6 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -32,3 +32,5 @@ def gitCheckoutAndRegister(String tool, String gitURL, String revision, String t gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) } + +return this diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 90dc7ee..06e5b50 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -51,3 +51,5 @@ boolean checkAllVersionsAgree(java.util.LinkedHashMap versions) { } return true } + +return this \ No newline at end of file From a1448ac8509c0b512092295700f1f0a6f61bba27 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:27:26 +0000 Subject: [PATCH 17/24] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index aa732e6..976ebf8 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -8,7 +8,7 @@ def registerConfigurationInfo(String configurationName, String configurationURL, } def registerPipelineScriptConfiguration() { - registerConfigurationInfo('pipeline script', '-', '-', getGitInfo("${WORKSPACE}")) + registerConfigurationInfo('pipeline script', '-', '-', gh.getGitInfo("${WORKSPACE}")) } def saveConfigurationInVersionInfo() { @@ -30,7 +30,7 @@ String getFormattedConfiguration() { def gitCheckoutAndRegister(String tool, String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { gh.gitCheckout(gitURL, revision, targetDir, repoRoot, cloneDepth, shallowClone) - registerConfigurationInfo(tool, gitURL, revision, getGitInfo(targetDir)) + registerConfigurationInfo(tool, gitURL, revision, gh.getGitInfo(targetDir)) } return this From d09d20c7b663d7a62cad3130ee91a05a96ab5f4a Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 17:30:21 +0000 Subject: [PATCH 18/24] Move commonly used methods out to Common_scripts --- configuration/configuration.gsh | 2 +- versioncontrol/git.gsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configuration/configuration.gsh b/configuration/configuration.gsh index 976ebf8..29cd7e3 100644 --- a/configuration/configuration.gsh +++ b/configuration/configuration.gsh @@ -1,4 +1,4 @@ -def gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") +gh = load("${WORKSPACE}/Common_scripts/versioncontrol/git.gsh") configurationCollection = [:] diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 06e5b50..fd633eb 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -1,4 +1,4 @@ -def clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") +clh = load("${WORKSPACE}/Common_scripts/commandline/commandline.gsh") String getGitInfo(String workingSetRootPath) { dir(workingSetRootPath) { From 9d32414fca002f779a7d924953dcf4cd7b7778a6 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 18:16:20 +0000 Subject: [PATCH 19/24] Check for undefined REPO_ROOT environment variable --- versioncontrol/git.gsh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index fd633eb..145045c 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -7,6 +7,13 @@ String getGitInfo(String workingSetRootPath) { } def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { + reporootenv = env.REPO_ROOT + if (reporootenv != mull && repoRoot != "") { + reporootpath = "${reporootenv.trim()}/${repoRoot}" + } else { + reporootpath = "" + echo "To improve Git performance: Define the REPO_ROOT enviroment to a path where a cache of git repositories can be placed on this slave" + } checkout([ $class: 'GitSCM', userRemoteConfigs: [ @@ -18,7 +25,7 @@ def gitCheckout(String gitURL, String revision, String targetDir, String repoRoo doGenerateSubmoduleConfigurations: false, extensions: [ [$class: 'CleanBeforeCheckout'], - [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: "${REPO_ROOT}/${repoRoot}", shallow: shallowClone, timeout: 120], + [$class: 'CloneOption', depth: cloneDepth, noTags: false, reference: reporootpath, shallow: shallowClone, timeout: 120], [$class: 'CheckoutOption', timeout: 60], [$class: 'RelativeTargetDirectory', relativeTargetDir: targetDir] ], From 69be84aac0e12da69f55d2c5b01f7ad22f775922 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sun, 18 Feb 2018 18:17:26 +0000 Subject: [PATCH 20/24] Check for undefined REPO_ROOT environment variable --- versioncontrol/git.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versioncontrol/git.gsh b/versioncontrol/git.gsh index 145045c..70fe6bc 100644 --- a/versioncontrol/git.gsh +++ b/versioncontrol/git.gsh @@ -8,7 +8,7 @@ String getGitInfo(String workingSetRootPath) { def gitCheckout(String gitURL, String revision, String targetDir, String repoRoot = "", int cloneDepth = 1, boolean shallowClone = true) { reporootenv = env.REPO_ROOT - if (reporootenv != mull && repoRoot != "") { + if (reporootenv != null && repoRoot != "") { reporootpath = "${reporootenv.trim()}/${repoRoot}" } else { reporootpath = "" From d1a8c098a6ba03fe5461f82db036de2f48aa2c62 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 19 Feb 2018 17:50:05 +0000 Subject: [PATCH 21/24] Make the version number 1.20000.x if the branch name is .x or ..x --- versionnumbering/versioninfo.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 59b5225..45fd1ca 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -65,10 +65,14 @@ def getGitRevision(gitrootpath, basenumber): return (adjustedchangecount, revision, remoteinfo) -def getVersionPrefix(sourcebranch): +# Handle: +# origin/master +# origin/2.0.x + def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) defaultversionprefix = "1.30000.0." + mastertypeversionprefix = "1.20000.0." splits = sourcebranch.split('/') if len(splits) < 1: print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) @@ -77,7 +81,7 @@ def getVersionPrefix(sourcebranch): sourcebranch = splits[-1] if sourcebranch.lower().endswith("master"): # Special case - return "1.20000.0." + return mastertypeversionprefix splits = sourcebranch.split('.') versionprefix = "" @@ -86,21 +90,27 @@ def getVersionPrefix(sourcebranch): versionprefix = defaultversionprefix else: splitnumbercount = 0 + isIntermediateReleaseBranch = false for split in splits: if split.isdigit(): versionprefix += split + "." splitnumbercount += 1 else: + if split == "x": + isIntermediateReleaseBranch = true break if splitnumbercount > 2: break if splitnumbercount == 0: print("No leading numbers were found in source branch name so defaulting to: {0}".format(defaultversionprefix)) versionprefix = defaultversionprefix - elif splitnumbercount == 1: - versionprefix += "0.0." - elif splitnumbercount == 2: - versionprefix += "0." + else: + if isIntermediateReleaseBranch: + versionprefix = mastertypeversionprefix + elif splitnumbercount == 1: + versionprefix += "0.0." + elif splitnumbercount == 2: + versionprefix += "0." print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix From 061b3d4fcfb9fe3f0a853b63cf6ea48ea8f1ce0b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 19 Feb 2018 18:14:49 +0000 Subject: [PATCH 22/24] Make the version number 1.20000.x if the branch name is .x or ..x --- .pydevproject | 2 +- versionnumbering/versioninfo.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pydevproject b/.pydevproject index d111c07..1ce5929 100644 --- a/.pydevproject +++ b/.pydevproject @@ -3,6 +3,6 @@ /${PROJECT_DIR_NAME} -python interpreter +python 2.7 python35 diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 45fd1ca..d9e6681 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -68,7 +68,7 @@ def getGitRevision(gitrootpath, basenumber): # Handle: # origin/master # origin/2.0.x - def getVersionPrefix(sourcebranch): +def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) defaultversionprefix = "1.30000.0." @@ -90,14 +90,14 @@ def getGitRevision(gitrootpath, basenumber): versionprefix = defaultversionprefix else: splitnumbercount = 0 - isIntermediateReleaseBranch = false + isIntermediateReleaseBranch = False for split in splits: if split.isdigit(): versionprefix += split + "." splitnumbercount += 1 else: if split == "x": - isIntermediateReleaseBranch = true + isIntermediateReleaseBranch = True break if splitnumbercount > 2: break From 9af8da5da65ee4420ce6394e5c34c3fedf9fef8f Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 20 Feb 2018 11:13:49 +0000 Subject: [PATCH 23/24] gitrevision.txt and revision.txt file content were mixed up with previous way of generating version folder --- versionnumbering/versioninfo.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index d9e6681..25644a6 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -115,7 +115,7 @@ def getVersionPrefix(sourcebranch): print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix -def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp): +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncount, gitrevision, remoteinfo, buildnumber, buildstamp): with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: f.write(buildjobname) @@ -123,6 +123,9 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, r f.write(versionprefix) with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: + f.write(gitrevisioncount) + + with open(os.path.join(versionfolder, "gitrevision.txt"), 'w') as f: f.write(gitrevision) with open(os.path.join(versionfolder, "remoteinfo.txt"), 'w') as f: @@ -195,7 +198,7 @@ USAGE buildstamp = versionprefix + str(gitrevisioncount) print("Build stamp is: {0}".format(buildstamp)) - writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp) + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncount, gitrevision, remoteinfo, buildnumber, buildstamp) return 0 except Exception as e: From d3ba4321ae5b3e3bedf77ec23d232a66b927c7f8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 20 Feb 2018 11:38:11 +0000 Subject: [PATCH 24/24] The print server base revision number is 5000 --- versionnumbering/versioninfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 25644a6..9a7cd6a 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -123,7 +123,7 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevisioncou f.write(versionprefix) with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: - f.write(gitrevisioncount) + f.write(str(gitrevisioncount)) with open(os.path.join(versionfolder, "gitrevision.txt"), 'w') as f: f.write(gitrevision)