From 245448fabe8331a7f97a2a06a3794b0c85f38f0a Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Fri, 12 Apr 2024 17:35:33 +0200 Subject: [PATCH 01/32] #475 Add task 'PublishBuildArtifacts' to integration stage Because upload_to_blob expect build artifact and not pipeline artifact --- azure-pipelines.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5ae975b3..bc742057 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,10 +36,10 @@ variables: # -- STAGES ---------------------------------------------------------------------------------------- stages: -- stage: report +- stage: variables_report pool: vmImage: "windows-2019" - displayName: "Report" + displayName: "Variables values" jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - job: show_variables_values @@ -62,7 +62,7 @@ stages: pool: vmImage: "windows-2019" displayName: "Build ZIP name" - dependsOn : report + dependsOn : variables_report condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) jobs: # -- CREATE zipName ----------------------------------------------------------------------------- @@ -162,6 +162,12 @@ stages: path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip artifact: $(zipName) + - task: PublishBuildArtifacts@1 + displayName: "Publish artifact: plugin packaged" + inputs: + PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip + ArtifactName: archive + - stage : upload_to_blob pool: vmImage: "ubuntu-latest" @@ -175,7 +181,7 @@ stages: - template : /on-premises/upload_to_blob.yml@templates parameters : zipName : "$(zipName)" - artifactName : "$(zipName)" + artifactName : archive - stage: versions_update condition: and(succeeded(), eq(variables.isProd, true)) From f3f1d8e28b10db64a6f7c1b790df50a3aa724c8e Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Fri, 12 Apr 2024 18:08:43 +0200 Subject: [PATCH 02/32] #475 Try to fix PublishBuildArtifacts --- azure-pipelines.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bc742057..053e7f50 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -157,15 +157,18 @@ stages: displayName: "Package - script ./tools/plugin_packager.py" - task: PublishPipelineArtifact@1 - displayName: "Publish artifact: plugin packaged" + displayName: "Publish pipeline artifact: plugin packaged" inputs: path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip artifact: $(zipName) + - script: ren $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip $(zipName) + displayName: "Package - rename archive for on premises artifact" + - task: PublishBuildArtifacts@1 - displayName: "Publish artifact: plugin packaged" + displayName: "Publish build artifact: plugin packaged for on premises" inputs: - PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip + PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) ArtifactName: archive - stage : upload_to_blob From 3a6f8b0f5fd0b08aead5f74db5d849cc45cb6d43 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 10:49:09 +0200 Subject: [PATCH 03/32] #475 Try to fix the name of the zip published as Build Artifact --- azure-pipelines.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 053e7f50..761cca8a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -68,7 +68,6 @@ stages: # -- CREATE zipName ----------------------------------------------------------------------------- - job: create_zipname_variable displayName: "Execute cmd script to set 'zipName' variable" - steps: - checkout: none - script: | @@ -99,7 +98,10 @@ stages: jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - job: format_lint_build_package - displayName: "Format and lint code, then build and package the plugin" + displayName: "Format & lint code, then build & package" + variables: + - name: windowsWorkingDirectory + value: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\')] steps: - checkout: self @@ -162,7 +164,11 @@ stages: path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip artifact: $(zipName) - - script: ren $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip $(zipName) + - script: | + echo windowsWorkingDirectory - $(windowsWorkingDirectory) + ls $(windowsWorkingDirectory)\build\latest\ + ren $(windowsWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) + ls $(windowsWorkingDirectory)\build\latest\ displayName: "Package - rename archive for on premises artifact" - task: PublishBuildArtifacts@1 @@ -180,6 +186,7 @@ stages: - build_zipname variables : zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + displayName: "Upload packaged plugin to Blob Storage" jobs: - template : /on-premises/upload_to_blob.yml@templates parameters : @@ -190,6 +197,7 @@ stages: condition: and(succeeded(), eq(variables.isProd, true)) dependsOn : - upload_to_blob + displayName: "Add new plugin version to versions.json file" jobs: - template : /on-premises/update_versions.yml@templates From 2baa2a68877a7e7abedded22cf2f4a99d1b24cbd Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 11:09:53 +0200 Subject: [PATCH 04/32] #475 try to fix 'windowsWorkingDirectory' variable definition --- azure-pipelines.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 761cca8a..0a7572ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,6 +33,7 @@ variables: azureSubscription : $(AZURE_SUBSCRIPTION) releaseDate: $[format('{0:dd}.{0:MM}.{0:yyyy}', pipeline.startTime)] releaseDateWithHour: $[format('{0:dd}.{0:MM}.{0:yyyy}-{0:HH}.{0:mm}', pipeline.startTime)] + windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\')] # -- STAGES ---------------------------------------------------------------------------------------- stages: @@ -57,6 +58,7 @@ stages: echo isDebug - $(isDebug) echo releaseDate - $(releaseDate) echo releaseDateWithHour - $(releaseDateWithHour) + echo windowsWorkingDirectory - $(windowsWorkingDirectory) - stage : build_zipname pool: @@ -99,9 +101,6 @@ stages: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - job: format_lint_build_package displayName: "Format & lint code, then build & package" - variables: - - name: windowsWorkingDirectory - value: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\')] steps: - checkout: self @@ -165,7 +164,6 @@ stages: artifact: $(zipName) - script: | - echo windowsWorkingDirectory - $(windowsWorkingDirectory) ls $(windowsWorkingDirectory)\build\latest\ ren $(windowsWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) ls $(windowsWorkingDirectory)\build\latest\ From 6f92ee0fb41b00d04348f0cade2d2740d0a03988 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 11:14:23 +0200 Subject: [PATCH 05/32] #475 try to fix 'windowsWorkingDirectory' variable definition again --- azure-pipelines.yml | 365 ++++++++++++++++++++++---------------------- 1 file changed, 183 insertions(+), 182 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0a7572ba..673ee8ad 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,7 +33,7 @@ variables: azureSubscription : $(AZURE_SUBSCRIPTION) releaseDate: $[format('{0:dd}.{0:MM}.{0:yyyy}', pipeline.startTime)] releaseDateWithHour: $[format('{0:dd}.{0:MM}.{0:yyyy}-{0:HH}.{0:mm}', pipeline.startTime)] - windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\')] + windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\\')] # -- STAGES ---------------------------------------------------------------------------------------- stages: @@ -52,6 +52,7 @@ stages: echo NAME - $(NAME) echo Build.BuildId - $(Build.BuildId) echo Build.SourceBranch - $(Build.SourceBranch) + echo System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory) echo pythonVersion - $(pythonVersion) echo isProd - $(isProd) echo isQA - $(isQA) @@ -60,184 +61,184 @@ stages: echo releaseDateWithHour - $(releaseDateWithHour) echo windowsWorkingDirectory - $(windowsWorkingDirectory) -- stage : build_zipname - pool: - vmImage: "windows-2019" - displayName: "Build ZIP name" - dependsOn : variables_report - condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) - jobs: - # -- CREATE zipName ----------------------------------------------------------------------------- - - job: create_zipname_variable - displayName: "Execute cmd script to set 'zipName' variable" - steps: - - checkout: none - - script: | - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - - if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip - if $(isDebug)==True set ZIPNAME=$(NAME)-debug-$(git describe --tags $(git rev-list --tags --max-count=1))-$(releaseDate).zip - echo %ZIPNAME% - - echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - echo $(zipName) - - name: set_zipname_variable - -- stage: integration - pool: - vmImage: "windows-2019" - dependsOn : build_zipname - condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] - displayName: "Integration" - jobs: - # -- LINT AND FORMAT ----------------------------------------------------------------------------- - - job: format_lint_build_package - displayName: "Format & lint code, then build & package" - - steps: - - checkout: self - fetchDepth: 10 - - - script: | - echo NAME - $(zipName) - - - task: UsePythonVersion@0 - inputs: - versionSpec: $(pythonVersion) - architecture: 'x64' - addToPath: true - displayName: "Install - Python ${{ variables.pythonVersion }}" - - - script: | - python -m pip install -U pip --cache-dir ./.pipcache - python -m pip install -U -r ./requirements.txt --cache-dir ./.pipcache - displayName: "Install - Dependencies" - - - script: | - python -m black --target-version=py37 .\isogeo.py - python -m black --target-version=py37 .\modules - python -m black --target-version=py37 .\ui - displayName: "Format - black code formatting" - - - script: | - flake8 ./isogeo.py --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 ./modules --count --select=E9,F63,F7,F82 --show-source --statistics - flake8 ./isogeo.py --count --exit-zero --max-complexity=10 --max-line-length=100 - flake8 ./modules --count --exit-zero --max-complexity=10 --max-line-length=100 - displayName: "Lint - Static code analisis" - - - script: | - pylupdate5 -noobsolete -verbose isogeo_search_engine.pro - qt5-tools lrelease .\i18n\isogeo_search_engine_en.ts - qt5-tools lrelease .\i18n\isogeo_search_engine_fr.ts - displayName: "Build - Qt translations (i18n)" - - - script: | - pyrcc5 resources.qrc -o resources_rc.py - displayName: "Build - Qt resources compilation" - - - script: | - pyuic5 -x "ui\isogeo_dockwidget_base.ui" -o "ui\ui_isogeo.py" - pyuic5 -x "ui\auth\ui_authentication.ui" -o "ui\auth\ui_authentication.py" - pyuic5 -x "ui\credits\ui_credits.ui" -o "ui\credits\ui_credits.py" - pyuic5 -x "ui\db_connections\ui_db_connections.ui" -o "ui\db_connections\ui_db_connections.py" - pyuic5 -x "ui\metadata\ui_md_details.ui" -o "ui\metadata\ui_md_details.py" - pyuic5 -x "ui\quicksearch\ui_quicksearch_rename.ui" -o "ui\quicksearch\ui_quicksearch_rename.py" - pyuic5 -x "ui\quicksearch\ui_quicksearch_new.ui" -o "ui\quicksearch\ui_quicksearch_new.py" - displayName: "Build - Qt UI files compilation" - - - script: python ./tools/plugin_packager.py - displayName: "Package - script ./tools/plugin_packager.py" - - - task: PublishPipelineArtifact@1 - displayName: "Publish pipeline artifact: plugin packaged" - inputs: - path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip - artifact: $(zipName) - - - script: | - ls $(windowsWorkingDirectory)\build\latest\ - ren $(windowsWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) - ls $(windowsWorkingDirectory)\build\latest\ - displayName: "Package - rename archive for on premises artifact" - - - task: PublishBuildArtifacts@1 - displayName: "Publish build artifact: plugin packaged for on premises" - inputs: - PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) - ArtifactName: archive - -- stage : upload_to_blob - pool: - vmImage: "ubuntu-latest" - condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) - dependsOn : - - integration - - build_zipname - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] - displayName: "Upload packaged plugin to Blob Storage" - jobs: - - template : /on-premises/upload_to_blob.yml@templates - parameters : - zipName : "$(zipName)" - artifactName : archive - -- stage: versions_update - condition: and(succeeded(), eq(variables.isProd, true)) - dependsOn : - - upload_to_blob - displayName: "Add new plugin version to versions.json file" - jobs: - - template : /on-premises/update_versions.yml@templates - -- stage: installer_tag - condition: and(succeeded(), eq(variables.isProd, true)) - dependsOn: versions_update - jobs : - - template : /on-premises/retrieve_github_pat.yml@templates - - template : /on-premises/installer_tag.yml@templates - -- stage: publish_to_github - displayName: "Create a GitHub release for tag ${{ variables.tagName }}" - dependsOn: - - integration - - build_zipname - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] - condition: and(succeeded(), eq(variables.isProd, true)) - - jobs: - - - job: 'create_github_release' - - steps: - - checkout: none - - - task: DownloadPipelineArtifact@2 - displayName: "Download packaged source code saved during 'integration' stage" - inputs: - buildType: "current" - artifactName: $(zipName) - targetPath: "$(System.DefaultWorkingDirectory)" - - - task: GitHubRelease@1 - continueOnError: true - displayName: "Publish tagged code as Github Release" - inputs: - gitHubConnection: 'github.com_SimonSAMPERE' - repositoryName: '$(Build.Repository.Name)' - action: 'create' - assets: "$(System.DefaultWorkingDirectory)/*" - target: '$(Build.SourceVersion)' - tagSource: 'gitTag' - changeLogCompareToRelease: 'lastFullRelease' - changeLogType: 'commitBased' \ No newline at end of file +# - stage : build_zipname +# pool: +# vmImage: "windows-2019" +# displayName: "Build ZIP name" +# dependsOn : variables_report +# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) +# jobs: +# # -- CREATE zipName ----------------------------------------------------------------------------- +# - job: create_zipname_variable +# displayName: "Execute cmd script to set 'zipName' variable" +# steps: +# - checkout: none +# - script: | +# echo isProd - $(isProd) +# echo isQA - $(isQA) +# echo isDebug - $(isDebug) + +# if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip +# if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip +# if $(isDebug)==True set ZIPNAME=$(NAME)-debug-$(git describe --tags $(git rev-list --tags --max-count=1))-$(releaseDate).zip +# echo %ZIPNAME% + +# echo ##vso[task.setvariable variable=zipName]%ZIPNAME% +# echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + +# echo $(zipName) + +# name: set_zipname_variable + +# - stage: integration +# pool: +# vmImage: "windows-2019" +# dependsOn : build_zipname +# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) +# variables : +# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] +# displayName: "Integration" +# jobs: +# # -- LINT AND FORMAT ----------------------------------------------------------------------------- +# - job: format_lint_build_package +# displayName: "Format & lint code, then build & package" + +# steps: +# - checkout: self +# fetchDepth: 10 + +# - script: | +# echo NAME - $(zipName) + +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: $(pythonVersion) +# architecture: 'x64' +# addToPath: true +# displayName: "Install - Python ${{ variables.pythonVersion }}" + +# - script: | +# python -m pip install -U pip --cache-dir ./.pipcache +# python -m pip install -U -r ./requirements.txt --cache-dir ./.pipcache +# displayName: "Install - Dependencies" + +# - script: | +# python -m black --target-version=py37 .\isogeo.py +# python -m black --target-version=py37 .\modules +# python -m black --target-version=py37 .\ui +# displayName: "Format - black code formatting" + +# - script: | +# flake8 ./isogeo.py --count --select=E9,F63,F7,F82 --show-source --statistics +# flake8 ./modules --count --select=E9,F63,F7,F82 --show-source --statistics +# flake8 ./isogeo.py --count --exit-zero --max-complexity=10 --max-line-length=100 +# flake8 ./modules --count --exit-zero --max-complexity=10 --max-line-length=100 +# displayName: "Lint - Static code analisis" + +# - script: | +# pylupdate5 -noobsolete -verbose isogeo_search_engine.pro +# qt5-tools lrelease .\i18n\isogeo_search_engine_en.ts +# qt5-tools lrelease .\i18n\isogeo_search_engine_fr.ts +# displayName: "Build - Qt translations (i18n)" + +# - script: | +# pyrcc5 resources.qrc -o resources_rc.py +# displayName: "Build - Qt resources compilation" + +# - script: | +# pyuic5 -x "ui\isogeo_dockwidget_base.ui" -o "ui\ui_isogeo.py" +# pyuic5 -x "ui\auth\ui_authentication.ui" -o "ui\auth\ui_authentication.py" +# pyuic5 -x "ui\credits\ui_credits.ui" -o "ui\credits\ui_credits.py" +# pyuic5 -x "ui\db_connections\ui_db_connections.ui" -o "ui\db_connections\ui_db_connections.py" +# pyuic5 -x "ui\metadata\ui_md_details.ui" -o "ui\metadata\ui_md_details.py" +# pyuic5 -x "ui\quicksearch\ui_quicksearch_rename.ui" -o "ui\quicksearch\ui_quicksearch_rename.py" +# pyuic5 -x "ui\quicksearch\ui_quicksearch_new.ui" -o "ui\quicksearch\ui_quicksearch_new.py" +# displayName: "Build - Qt UI files compilation" + +# - script: python ./tools/plugin_packager.py +# displayName: "Package - script ./tools/plugin_packager.py" + +# - task: PublishPipelineArtifact@1 +# displayName: "Publish pipeline artifact: plugin packaged" +# inputs: +# path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip +# artifact: $(zipName) + +# - script: | +# ls $(windowsWorkingDirectory)\build\latest\ +# ren $(windowsWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) +# ls $(windowsWorkingDirectory)\build\latest\ +# displayName: "Package - rename archive for on premises artifact" + +# - task: PublishBuildArtifacts@1 +# displayName: "Publish build artifact: plugin packaged for on premises" +# inputs: +# PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) +# ArtifactName: archive + +# - stage : upload_to_blob +# pool: +# vmImage: "ubuntu-latest" +# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) +# dependsOn : +# - integration +# - build_zipname +# variables : +# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] +# displayName: "Upload packaged plugin to Blob Storage" +# jobs: +# - template : /on-premises/upload_to_blob.yml@templates +# parameters : +# zipName : "$(zipName)" +# artifactName : archive + +# - stage: versions_update +# condition: and(succeeded(), eq(variables.isProd, true)) +# dependsOn : +# - upload_to_blob +# displayName: "Add new plugin version to versions.json file" +# jobs: +# - template : /on-premises/update_versions.yml@templates + +# - stage: installer_tag +# condition: and(succeeded(), eq(variables.isProd, true)) +# dependsOn: versions_update +# jobs : +# - template : /on-premises/retrieve_github_pat.yml@templates +# - template : /on-premises/installer_tag.yml@templates + +# - stage: publish_to_github +# displayName: "Create a GitHub release for tag ${{ variables.tagName }}" +# dependsOn: +# - integration +# - build_zipname +# variables : +# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] +# condition: and(succeeded(), eq(variables.isProd, true)) + +# jobs: + +# - job: 'create_github_release' + +# steps: +# - checkout: none + +# - task: DownloadPipelineArtifact@2 +# displayName: "Download packaged source code saved during 'integration' stage" +# inputs: +# buildType: "current" +# artifactName: $(zipName) +# targetPath: "$(System.DefaultWorkingDirectory)" + +# - task: GitHubRelease@1 +# continueOnError: true +# displayName: "Publish tagged code as Github Release" +# inputs: +# gitHubConnection: 'github.com_SimonSAMPERE' +# repositoryName: '$(Build.Repository.Name)' +# action: 'create' +# assets: "$(System.DefaultWorkingDirectory)/*" +# target: '$(Build.SourceVersion)' +# tagSource: 'gitTag' +# changeLogCompareToRelease: 'lastFullRelease' +# changeLogType: 'commitBased' \ No newline at end of file From 8d86bae2524ee342f8f818e62e8857fe26896d6e Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 11:20:24 +0200 Subject: [PATCH 06/32] #475 Try to fix the name of the zip published as Build Artifact again --- azure-pipelines.yml | 368 ++++++++++++++++++++++---------------------- 1 file changed, 184 insertions(+), 184 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 673ee8ad..eb18ee73 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,7 +33,7 @@ variables: azureSubscription : $(AZURE_SUBSCRIPTION) releaseDate: $[format('{0:dd}.{0:MM}.{0:yyyy}', pipeline.startTime)] releaseDateWithHour: $[format('{0:dd}.{0:MM}.{0:yyyy}-{0:HH}.{0:mm}', pipeline.startTime)] - windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\\')] + # windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\\')] # -- STAGES ---------------------------------------------------------------------------------------- stages: @@ -59,186 +59,186 @@ stages: echo isDebug - $(isDebug) echo releaseDate - $(releaseDate) echo releaseDateWithHour - $(releaseDateWithHour) - echo windowsWorkingDirectory - $(windowsWorkingDirectory) - -# - stage : build_zipname -# pool: -# vmImage: "windows-2019" -# displayName: "Build ZIP name" -# dependsOn : variables_report -# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) -# jobs: -# # -- CREATE zipName ----------------------------------------------------------------------------- -# - job: create_zipname_variable -# displayName: "Execute cmd script to set 'zipName' variable" -# steps: -# - checkout: none -# - script: | -# echo isProd - $(isProd) -# echo isQA - $(isQA) -# echo isDebug - $(isDebug) - -# if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip -# if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip -# if $(isDebug)==True set ZIPNAME=$(NAME)-debug-$(git describe --tags $(git rev-list --tags --max-count=1))-$(releaseDate).zip -# echo %ZIPNAME% - -# echo ##vso[task.setvariable variable=zipName]%ZIPNAME% -# echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - -# echo $(zipName) - -# name: set_zipname_variable - -# - stage: integration -# pool: -# vmImage: "windows-2019" -# dependsOn : build_zipname -# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) -# variables : -# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] -# displayName: "Integration" -# jobs: -# # -- LINT AND FORMAT ----------------------------------------------------------------------------- -# - job: format_lint_build_package -# displayName: "Format & lint code, then build & package" - -# steps: -# - checkout: self -# fetchDepth: 10 - -# - script: | -# echo NAME - $(zipName) - -# - task: UsePythonVersion@0 -# inputs: -# versionSpec: $(pythonVersion) -# architecture: 'x64' -# addToPath: true -# displayName: "Install - Python ${{ variables.pythonVersion }}" - -# - script: | -# python -m pip install -U pip --cache-dir ./.pipcache -# python -m pip install -U -r ./requirements.txt --cache-dir ./.pipcache -# displayName: "Install - Dependencies" - -# - script: | -# python -m black --target-version=py37 .\isogeo.py -# python -m black --target-version=py37 .\modules -# python -m black --target-version=py37 .\ui -# displayName: "Format - black code formatting" - -# - script: | -# flake8 ./isogeo.py --count --select=E9,F63,F7,F82 --show-source --statistics -# flake8 ./modules --count --select=E9,F63,F7,F82 --show-source --statistics -# flake8 ./isogeo.py --count --exit-zero --max-complexity=10 --max-line-length=100 -# flake8 ./modules --count --exit-zero --max-complexity=10 --max-line-length=100 -# displayName: "Lint - Static code analisis" - -# - script: | -# pylupdate5 -noobsolete -verbose isogeo_search_engine.pro -# qt5-tools lrelease .\i18n\isogeo_search_engine_en.ts -# qt5-tools lrelease .\i18n\isogeo_search_engine_fr.ts -# displayName: "Build - Qt translations (i18n)" - -# - script: | -# pyrcc5 resources.qrc -o resources_rc.py -# displayName: "Build - Qt resources compilation" - -# - script: | -# pyuic5 -x "ui\isogeo_dockwidget_base.ui" -o "ui\ui_isogeo.py" -# pyuic5 -x "ui\auth\ui_authentication.ui" -o "ui\auth\ui_authentication.py" -# pyuic5 -x "ui\credits\ui_credits.ui" -o "ui\credits\ui_credits.py" -# pyuic5 -x "ui\db_connections\ui_db_connections.ui" -o "ui\db_connections\ui_db_connections.py" -# pyuic5 -x "ui\metadata\ui_md_details.ui" -o "ui\metadata\ui_md_details.py" -# pyuic5 -x "ui\quicksearch\ui_quicksearch_rename.ui" -o "ui\quicksearch\ui_quicksearch_rename.py" -# pyuic5 -x "ui\quicksearch\ui_quicksearch_new.ui" -o "ui\quicksearch\ui_quicksearch_new.py" -# displayName: "Build - Qt UI files compilation" - -# - script: python ./tools/plugin_packager.py -# displayName: "Package - script ./tools/plugin_packager.py" - -# - task: PublishPipelineArtifact@1 -# displayName: "Publish pipeline artifact: plugin packaged" -# inputs: -# path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip -# artifact: $(zipName) - -# - script: | -# ls $(windowsWorkingDirectory)\build\latest\ -# ren $(windowsWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) -# ls $(windowsWorkingDirectory)\build\latest\ -# displayName: "Package - rename archive for on premises artifact" - -# - task: PublishBuildArtifacts@1 -# displayName: "Publish build artifact: plugin packaged for on premises" -# inputs: -# PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) -# ArtifactName: archive - -# - stage : upload_to_blob -# pool: -# vmImage: "ubuntu-latest" -# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) -# dependsOn : -# - integration -# - build_zipname -# variables : -# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] -# displayName: "Upload packaged plugin to Blob Storage" -# jobs: -# - template : /on-premises/upload_to_blob.yml@templates -# parameters : -# zipName : "$(zipName)" -# artifactName : archive - -# - stage: versions_update -# condition: and(succeeded(), eq(variables.isProd, true)) -# dependsOn : -# - upload_to_blob -# displayName: "Add new plugin version to versions.json file" -# jobs: -# - template : /on-premises/update_versions.yml@templates - -# - stage: installer_tag -# condition: and(succeeded(), eq(variables.isProd, true)) -# dependsOn: versions_update -# jobs : -# - template : /on-premises/retrieve_github_pat.yml@templates -# - template : /on-premises/installer_tag.yml@templates - -# - stage: publish_to_github -# displayName: "Create a GitHub release for tag ${{ variables.tagName }}" -# dependsOn: -# - integration -# - build_zipname -# variables : -# zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] -# condition: and(succeeded(), eq(variables.isProd, true)) - -# jobs: - -# - job: 'create_github_release' - -# steps: -# - checkout: none - -# - task: DownloadPipelineArtifact@2 -# displayName: "Download packaged source code saved during 'integration' stage" -# inputs: -# buildType: "current" -# artifactName: $(zipName) -# targetPath: "$(System.DefaultWorkingDirectory)" - -# - task: GitHubRelease@1 -# continueOnError: true -# displayName: "Publish tagged code as Github Release" -# inputs: -# gitHubConnection: 'github.com_SimonSAMPERE' -# repositoryName: '$(Build.Repository.Name)' -# action: 'create' -# assets: "$(System.DefaultWorkingDirectory)/*" -# target: '$(Build.SourceVersion)' -# tagSource: 'gitTag' -# changeLogCompareToRelease: 'lastFullRelease' -# changeLogType: 'commitBased' \ No newline at end of file + +- stage : build_zipname + pool: + vmImage: "windows-2019" + displayName: "Build ZIP name" + dependsOn : variables_report + condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) + jobs: + # -- CREATE zipName ----------------------------------------------------------------------------- + - job: create_zipname_variable + displayName: "Execute cmd script to set 'zipName' variable" + steps: + - checkout: none + - script: | + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) + + if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + if $(isDebug)==True set ZIPNAME=$(NAME)-debug-$(git describe --tags $(git rev-list --tags --max-count=1))-$(releaseDate).zip + echo %ZIPNAME% + + echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + echo $(zipName) + + name: set_zipname_variable + +- stage: integration + pool: + vmImage: "windows-2019" + dependsOn : build_zipname + condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) + variables : + zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + displayName: "Integration" + jobs: + # -- LINT AND FORMAT ----------------------------------------------------------------------------- + - job: format_lint_build_package + displayName: "Format & lint code, then build & package" + + steps: + - checkout: self + fetchDepth: 10 + + - script: | + echo NAME - $(zipName) + + - task: UsePythonVersion@0 + inputs: + versionSpec: $(pythonVersion) + architecture: 'x64' + addToPath: true + displayName: "Install - Python ${{ variables.pythonVersion }}" + + - script: | + python -m pip install -U pip --cache-dir ./.pipcache + python -m pip install -U -r ./requirements.txt --cache-dir ./.pipcache + displayName: "Install - Dependencies" + + - script: | + python -m black --target-version=py37 .\isogeo.py + python -m black --target-version=py37 .\modules + python -m black --target-version=py37 .\ui + displayName: "Format - black code formatting" + + - script: | + flake8 ./isogeo.py --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 ./modules --count --select=E9,F63,F7,F82 --show-source --statistics + flake8 ./isogeo.py --count --exit-zero --max-complexity=10 --max-line-length=100 + flake8 ./modules --count --exit-zero --max-complexity=10 --max-line-length=100 + displayName: "Lint - Static code analisis" + + - script: | + pylupdate5 -noobsolete -verbose isogeo_search_engine.pro + qt5-tools lrelease .\i18n\isogeo_search_engine_en.ts + qt5-tools lrelease .\i18n\isogeo_search_engine_fr.ts + displayName: "Build - Qt translations (i18n)" + + - script: | + pyrcc5 resources.qrc -o resources_rc.py + displayName: "Build - Qt resources compilation" + + - script: | + pyuic5 -x "ui\isogeo_dockwidget_base.ui" -o "ui\ui_isogeo.py" + pyuic5 -x "ui\auth\ui_authentication.ui" -o "ui\auth\ui_authentication.py" + pyuic5 -x "ui\credits\ui_credits.ui" -o "ui\credits\ui_credits.py" + pyuic5 -x "ui\db_connections\ui_db_connections.ui" -o "ui\db_connections\ui_db_connections.py" + pyuic5 -x "ui\metadata\ui_md_details.ui" -o "ui\metadata\ui_md_details.py" + pyuic5 -x "ui\quicksearch\ui_quicksearch_rename.ui" -o "ui\quicksearch\ui_quicksearch_rename.py" + pyuic5 -x "ui\quicksearch\ui_quicksearch_new.ui" -o "ui\quicksearch\ui_quicksearch_new.py" + displayName: "Build - Qt UI files compilation" + + - script: python ./tools/plugin_packager.py + displayName: "Package - script ./tools/plugin_packager.py" + + - task: PublishPipelineArtifact@1 + displayName: "Publish pipeline artifact: plugin packaged" + inputs: + path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip + artifact: $(zipName) + + - script: | + echo $(System.DefaultWorkingDirectory)\build\latest\ + ls $(System.DefaultWorkingDirectory)\build\latest\ + ren $(System.DefaultWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) + ls $(System.DefaultWorkingDirectory)\build\latest\ + displayName: "Package - rename archive for on premises artifact" + + - task: PublishBuildArtifacts@1 + displayName: "Publish build artifact: plugin packaged for on premises" + inputs: + PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) + ArtifactName: archive + +- stage : upload_to_blob + pool: + vmImage: "ubuntu-latest" + condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) + dependsOn : + - integration + - build_zipname + variables : + zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + displayName: "Upload packaged plugin to Blob Storage" + jobs: + - template : /on-premises/upload_to_blob.yml@templates + parameters : + zipName : "$(zipName)" + artifactName : archive + +- stage: versions_update + condition: and(succeeded(), eq(variables.isProd, true)) + dependsOn : + - upload_to_blob + displayName: "Add new plugin version to versions.json file" + jobs: + - template : /on-premises/update_versions.yml@templates + +- stage: installer_tag + condition: and(succeeded(), eq(variables.isProd, true)) + dependsOn: versions_update + jobs : + - template : /on-premises/retrieve_github_pat.yml@templates + - template : /on-premises/installer_tag.yml@templates + +- stage: publish_to_github + displayName: "Create a GitHub release for tag ${{ variables.tagName }}" + dependsOn: + - integration + - build_zipname + variables : + zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + condition: and(succeeded(), eq(variables.isProd, true)) + + jobs: + + - job: 'create_github_release' + + steps: + - checkout: none + + - task: DownloadPipelineArtifact@2 + displayName: "Download packaged source code saved during 'integration' stage" + inputs: + buildType: "current" + artifactName: $(zipName) + targetPath: "$(System.DefaultWorkingDirectory)" + + - task: GitHubRelease@1 + continueOnError: true + displayName: "Publish tagged code as Github Release" + inputs: + gitHubConnection: 'github.com_SimonSAMPERE' + repositoryName: '$(Build.Repository.Name)' + action: 'create' + assets: "$(System.DefaultWorkingDirectory)/*" + target: '$(Build.SourceVersion)' + tagSource: 'gitTag' + changeLogCompareToRelease: 'lastFullRelease' + changeLogType: 'commitBased' \ No newline at end of file From 483658f389bfdc2a9aba2caf14b255efc4e430ad Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 15:04:52 +0200 Subject: [PATCH 07/32] #475 Fix zipName generation in case of debug version --- azure-pipelines.yml | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb18ee73..f37d70dc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,23 +71,31 @@ stages: - job: create_zipname_variable displayName: "Execute cmd script to set 'zipName' variable" steps: - - checkout: none - - script: | - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - - if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip - if $(isDebug)==True set ZIPNAME=$(NAME)-debug-$(git describe --tags $(git rev-list --tags --max-count=1))-$(releaseDate).zip - echo %ZIPNAME% - - echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - echo $(zipName) - - name: set_zipname_variable + - checkout: self + fetchTags: true + - script: | + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) + + if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + if [[$(isDebug)==True]] ; then + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) + echo COMMIT: %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip + echo %ZIPNAME% + + echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + echo $(zipName) + + name: set_zipname_variable - stage: integration pool: From b03cdba6021162a069a464079d8f9f97952adcbc Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 15:11:43 +0200 Subject: [PATCH 08/32] #475 try to fix zipName generation condtion --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f37d70dc..32fb1c2d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,8 +78,6 @@ stages: echo isQA - $(isQA) echo isDebug - $(isDebug) - if $(isProd)==True set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - if $(isQA)==True set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip if [[$(isDebug)==True]] ; then git rev-list --tags --max-count=1 for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) @@ -88,6 +86,10 @@ stages: for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) echo TAG: %TAG% set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip + elif [[$(isProd)==True]] ; then + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + elif [[$(isQA)==True]] ; then + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip echo %ZIPNAME% echo ##vso[task.setvariable variable=zipName]%ZIPNAME% From c00658b297daa8a459ffe385a10c8107e27420d5 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 15:18:46 +0200 Subject: [PATCH 09/32] #475 try to fix zipName generation condtion again --- azure-pipelines.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 32fb1c2d..7b2e7a1e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,8 +77,13 @@ stages: echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) - - if [[$(isDebug)==True]] ; then + IF $(isProd)==True ( + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + ) + IF $(isQA)==True ( + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + ) + IF $(isDebug)==True ( git rev-list --tags --max-count=1 for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) echo COMMIT: %COMMIT% @@ -86,10 +91,7 @@ stages: for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) echo TAG: %TAG% set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip - elif [[$(isProd)==True]] ; then - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - elif [[$(isQA)==True]] ; then - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + ) echo %ZIPNAME% echo ##vso[task.setvariable variable=zipName]%ZIPNAME% From 2f4063b739984a4350b068d295be3c98ac12a757 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 15:32:44 +0200 Subject: [PATCH 10/32] #475 try to fix zipName generation condtion by splitting steps --- azure-pipelines.yml | 89 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7b2e7a1e..9ca0a0a7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,29 +77,86 @@ stages: echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) - IF $(isProd)==True ( - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - ) - IF $(isQA)==True ( - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip - ) - IF $(isDebug)==True ( - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) - echo COMMIT: %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip - ) + + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + echo %ZIPNAME% echo ##vso[task.setvariable variable=zipName]%ZIPNAME% echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% echo $(zipName) + condition: and(succeeded(), eq(variables.isProd, true)) + name: set_zipname_variable_prod + + - script: | + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) - name: set_zipname_variable + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + + echo %ZIPNAME% + + echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + echo $(zipName) + condition: and(succeeded(), eq(variables.isQA, true)) + name: set_zipname_variable_qa + + - script: | + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) + + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) + echo COMMIT: %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip + + echo %ZIPNAME% + + echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + echo $(zipName) + condition: and(succeeded(), eq(variables.isDebug, true)) + name: set_zipname_variable_debug + # - script: | + # echo isProd - $(isProd) + # echo isQA - $(isQA) + # echo isDebug - $(isDebug) + + # IF $(isProd)==True ( + # set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip + # ) + + # IF $(isQA)==True ( + # set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + # ) + + # IF $(isDebug)==True ( + # git rev-list --tags --max-count=1 + # for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) + # echo COMMIT: %COMMIT% + # git describe --tags %COMMIT% + # for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) + # echo TAG: %TAG% + # set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip + # ) + + # echo %ZIPNAME% + + # echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + # echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + # echo $(zipName) + + # name: set_zipname_variable - stage: integration pool: From 884d90a109e061e248eb7642428f7dcf409d39f9 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 23:30:05 +0200 Subject: [PATCH 11/32] #475 Fix zipName generation in case of debug version for good --- azure-pipelines.yml | 111 ++++++++++++-------------------------------- 1 file changed, 29 insertions(+), 82 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9ca0a0a7..681aaf73 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -33,7 +33,6 @@ variables: azureSubscription : $(AZURE_SUBSCRIPTION) releaseDate: $[format('{0:dd}.{0:MM}.{0:yyyy}', pipeline.startTime)] releaseDateWithHour: $[format('{0:dd}.{0:MM}.{0:yyyy}-{0:HH}.{0:mm}', pipeline.startTime)] - # windowsWorkingDirectory: $[replace(variables['System.DefaultWorkingDirectory'], '/', '\\')] # -- STAGES ---------------------------------------------------------------------------------------- stages: @@ -71,52 +70,31 @@ stages: - job: create_zipname_variable displayName: "Execute cmd script to set 'zipName' variable" steps: - - checkout: self - fetchTags: true - - script: | - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - - echo %ZIPNAME% - - echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - echo $(zipName) - condition: and(succeeded(), eq(variables.isProd, true)) - name: set_zipname_variable_prod + - checkout : self + fetchTags: True - script: | echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip + IF "%isProd%"=="True" ( + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + ) - echo %ZIPNAME% + IF "%isQA%"=="True" ( + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + ) - echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - echo $(zipName) - condition: and(succeeded(), eq(variables.isQA, true)) - name: set_zipname_variable_qa - - - script: | - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) - echo COMMIT: %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip + IF "%isDebug%"=="True" ( + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) + echo COMMIT - %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) + ) echo %ZIPNAME% @@ -124,47 +102,16 @@ stages: echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% echo $(zipName) - condition: and(succeeded(), eq(variables.isDebug, true)) - name: set_zipname_variable_debug - # - script: | - # echo isProd - $(isProd) - # echo isQA - $(isQA) - # echo isDebug - $(isDebug) - - # IF $(isProd)==True ( - # set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||').zip - # ) - - # IF $(isQA)==True ( - # set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour).zip - # ) - - # IF $(isDebug)==True ( - # git rev-list --tags --max-count=1 - # for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do (SET COMMIT=%%a) - # echo COMMIT: %COMMIT% - # git describe --tags %COMMIT% - # for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do (SET TAG=%%b) - # echo TAG: %TAG% - # set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate).zip - # ) - - # echo %ZIPNAME% - - # echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - # echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - # echo $(zipName) - # name: set_zipname_variable + name: set_zipname_variable - stage: integration pool: vmImage: "windows-2019" dependsOn : build_zipname condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + variables: + zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] displayName: "Integration" jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- @@ -176,7 +123,7 @@ stages: fetchDepth: 10 - script: | - echo NAME - $(zipName) + echo zipName - $(zipName).zip - task: UsePythonVersion@0 inputs: @@ -235,14 +182,14 @@ stages: - script: | echo $(System.DefaultWorkingDirectory)\build\latest\ ls $(System.DefaultWorkingDirectory)\build\latest\ - ren $(System.DefaultWorkingDirectory)\build\latest\isogeo_search_engine.zip $(zipName) + mv $(System.DefaultWorkingDirectory)\build\latest\isogeo_search_engine.zip $(System.DefaultWorkingDirectory)\build\latest\$(zipName).zip ls $(System.DefaultWorkingDirectory)\build\latest\ displayName: "Package - rename archive for on premises artifact" - task: PublishBuildArtifacts@1 displayName: "Publish build artifact: plugin packaged for on premises" inputs: - PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName) + PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName).zip ArtifactName: archive - stage : upload_to_blob @@ -252,13 +199,13 @@ stages: dependsOn : - integration - build_zipname - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + variables: + zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] displayName: "Upload packaged plugin to Blob Storage" jobs: - template : /on-premises/upload_to_blob.yml@templates parameters : - zipName : "$(zipName)" + zipName: $(zipName).zip artifactName : archive - stage: versions_update @@ -281,8 +228,8 @@ stages: dependsOn: - integration - build_zipname - variables : - zipName : $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + variables: + zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] condition: and(succeeded(), eq(variables.isProd, true)) jobs: @@ -296,7 +243,7 @@ stages: displayName: "Download packaged source code saved during 'integration' stage" inputs: buildType: "current" - artifactName: $(zipName) + artifactName: $(zipName).zip targetPath: "$(System.DefaultWorkingDirectory)" - task: GitHubRelease@1 From 0263ee6d0ac451a39a6cf53a20bbd8d21f69cdaf Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 23:34:15 +0200 Subject: [PATCH 12/32] #475 --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 681aaf73..12ac27f3 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,6 +77,9 @@ stages: echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) + echo isProd - %isProd% + echo isQA - %isQA% + echo isDebug - %isDebug% IF "%isProd%"=="True" ( set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') From 80843e4752bd171a9b7883a9f437b13664fa5dbf Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 23:38:39 +0200 Subject: [PATCH 13/32] #475 --- azure-pipelines.yml | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 12ac27f3..7175cf42 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -82,21 +82,19 @@ stages: echo isDebug - %isDebug% IF "%isProd%"=="True" ( - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') - ) - + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + ) ELSE ( IF "%isQA%"=="True" ( - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + ) ELSE ( + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) + echo COMMIT - %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) ) - - IF "%isDebug%"=="True" ( - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) - echo COMMIT - %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) ) echo %ZIPNAME% From 192fac18dcd906526b2a8368095df793e0a1e7f1 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Mon, 15 Apr 2024 23:41:58 +0200 Subject: [PATCH 14/32] #475 --- azure-pipelines.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7175cf42..a893574f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -82,19 +82,19 @@ stages: echo isDebug - %isDebug% IF "%isProd%"=="True" ( - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') ) ELSE ( - IF "%isQA%"=="True" ( - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) - ) ELSE ( - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) - echo COMMIT - %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) - ) + IF "%isQA%"=="True" ( + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + ) ELSE ( + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) + echo COMMIT - %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) + ) ) echo %ZIPNAME% From d7895e071097c58811c25dd3343dc44eb575ca8c Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 12:34:54 +0200 Subject: [PATCH 15/32] #475 --- azure-pipelines.yml | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a893574f..02ec6b39 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,25 +77,24 @@ stages: echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) - echo isProd - %isProd% - echo isQA - %isQA% - echo isDebug - %isDebug% - IF "%isProd%"=="True" ( + if [ "$(isProd)" = "True" ]; then + echo isProd - %isProd% set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') - ) ELSE ( - IF "%isQA%"=="True" ( - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) - ) ELSE ( - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) - echo COMMIT - %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) - ) - ) + + if [ "$(isQA)" = "True" ]; then + echo isQA - %isQA% + set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + + if [ "$(isDebug)" = "True" ]; then + echo isDebug - %isDebug% + git rev-list --tags --max-count=1 + for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) + echo COMMIT - %COMMIT% + git describe --tags %COMMIT% + for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b + echo TAG: %TAG% + set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) echo %ZIPNAME% From a5ebcf65d88e7fb1d377c3922e24a93f16f34bdd Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 12:47:13 +0200 Subject: [PATCH 16/32] #475 Try to define zipName with a bash script instead of a batch script --- azure-pipelines.yml | 78 ++++++++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 02ec6b39..d3ee9d07 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -61,7 +61,8 @@ stages: - stage : build_zipname pool: - vmImage: "windows-2019" + vmImage: "ubuntu-latest" + # vmImage: "windows-2019" displayName: "Build ZIP name" dependsOn : variables_report condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) @@ -74,36 +75,63 @@ stages: fetchTags: True - script: | - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) if [ "$(isProd)" = "True" ]; then - echo isProd - %isProd% - set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') - - if [ "$(isQA)" = "True" ]; then - echo isQA - %isQA% - set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) - - if [ "$(isDebug)" = "True" ]; then - echo isDebug - %isDebug% - git rev-list --tags --max-count=1 - for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) - echo COMMIT - %COMMIT% - git describe --tags %COMMIT% - for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b - echo TAG: %TAG% - set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) - - echo %ZIPNAME% - - echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + echo isProd - $(isProd) + ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + + elif [ "$(isQA)" = "True" ]; then + echo isQA - $(isQA) + ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + + elif [ "$(isDebug)" = "True" ]; then + echo isDebug - $(isDebug) + TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" + ZIPNAME=$(NAME)-debug-$(TAG)-$(releaseDate) + else + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) + fi + echo $(ZIPNAME) + echo ##vso[task.setvariable variable=zipName]$ZIPNAME + echo ##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME echo $(zipName) name: set_zipname_variable + + # - script: | + # echo isProd - $(isProd) + # echo isQA - $(isQA) + # echo isDebug - $(isDebug) + + # if [ "$(isProd)" = "True" ]; then + # echo isProd - %isProd% + # set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + + # if [ "$(isQA)" = "True" ]; then + # echo isQA - %isQA% + # set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + + # if [ "$(isDebug)" = "True" ]; then + # echo isDebug - %isDebug% + # git rev-list --tags --max-count=1 + # for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) + # echo COMMIT - %COMMIT% + # git describe --tags %COMMIT% + # for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b + # echo TAG: %TAG% + # set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) + + # echo %ZIPNAME% + + # echo ##vso[task.setvariable variable=zipName]%ZIPNAME% + # echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% + + # echo $(zipName) + + # name: set_zipname_variable - stage: integration pool: From 891cd129e3495fb6755f4878f34a1607ebf0c7b9 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 12:51:17 +0200 Subject: [PATCH 17/32] #475 --- azure-pipelines.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d3ee9d07..7c4e515e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -93,11 +93,13 @@ stages: echo isQA - $(isQA) echo isDebug - $(isDebug) fi - echo $(ZIPNAME) - echo ##vso[task.setvariable variable=zipName]$ZIPNAME - echo ##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME - echo $(zipName) + echo "$(ZIPNAME)"" + + echo "##vso[task.setvariable variable=zipName]$ZIPNAME" + echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" + + echo "$(zipName)"" name: set_zipname_variable From 476a9abefdddfe56bac03764d57d45c0ec2d31b7 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 12:59:18 +0200 Subject: [PATCH 18/32] #475 --- azure-pipelines.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7c4e515e..11986093 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,20 +78,21 @@ stages: if [ "$(isProd)" = "True" ]; then echo isProd - $(isProd) - ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') + ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" elif [ "$(isQA)" = "True" ]; then echo isQA - $(isQA) - ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) + ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" elif [ "$(isDebug)" = "True" ]; then echo isDebug - $(isDebug) TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" - ZIPNAME=$(NAME)-debug-$(TAG)-$(releaseDate) + ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" else echo isProd - $(isProd) echo isQA - $(isQA) echo isDebug - $(isDebug) + ZIPNAME="$(NAME)" fi echo "$(ZIPNAME)"" From e394859ded41f5c95dd32ae7f8cc3be831679c63 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:01:59 +0200 Subject: [PATCH 19/32] #475 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 11986093..7e9d8486 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,7 +74,7 @@ stages: - checkout : self fetchTags: True - - script: | + - bash: | if [ "$(isProd)" = "True" ]; then echo isProd - $(isProd) From 244472ab0c9af076f42c15bcbd006b6625f2fd4e Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:09:55 +0200 Subject: [PATCH 20/32] #475 --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7e9d8486..7439dcdd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -95,8 +95,9 @@ stages: ZIPNAME="$(NAME)" fi - echo "$(ZIPNAME)"" + echo "$ZIPNAME"" + set -x echo "##vso[task.setvariable variable=zipName]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" From 648d555b64b5c624a9027a921efa6599ce78e514 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:17:32 +0200 Subject: [PATCH 21/32] #475 --- azure-pipelines.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7439dcdd..ceae19b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -75,7 +75,6 @@ stages: fetchTags: True - bash: | - if [ "$(isProd)" = "True" ]; then echo isProd - $(isProd) ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" @@ -95,15 +94,20 @@ stages: ZIPNAME="$(NAME)" fi - echo "$ZIPNAME"" + echo "$ZIPNAME" + + name: set_zipname_value - set -x + - bash: | + echo "$ZIPNAME" echo "##vso[task.setvariable variable=zipName]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" - echo "$(zipName)"" - name: set_zipname_variable + + - bash: | + echo $(zipName) + name: display_zipname_value # - script: | # echo isProd - $(isProd) From 6ec3d0337e9a6f32c8688616cb0fb65b449f75c1 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:22:54 +0200 Subject: [PATCH 22/32] #475 --- azure-pipelines.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ceae19b2..82cf29b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -100,13 +100,15 @@ stages: - bash: | echo "$ZIPNAME" - echo "##vso[task.setvariable variable=zipName]$ZIPNAME" + echo $ZIPNAME + echo $(ZIPNAME) + echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" name: set_zipname_variable - bash: | - echo $(zipName) + echo zipName - $(zipName) name: display_zipname_value # - script: | From 1c09938ec2537714f167b3904f7beba4e06e3f63 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:26:13 +0200 Subject: [PATCH 23/32] #475 --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 82cf29b2..ba1403a6 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,7 +101,6 @@ stages: - bash: | echo "$ZIPNAME" echo $ZIPNAME - echo $(ZIPNAME) echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" From 98e311dbb8ed774233475deade4bfcb17bc81020 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:28:11 +0200 Subject: [PATCH 24/32] #475 --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba1403a6..8b080ea2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -94,15 +94,15 @@ stages: ZIPNAME="$(NAME)" fi - echo "$ZIPNAME" + echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" + echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" name: set_zipname_value - bash: | echo "$ZIPNAME" echo $ZIPNAME - echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" - echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" + echo $zipName name: set_zipname_variable From ff254fdc05b6d082756f668b439c252ebd3a13f5 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:30:57 +0200 Subject: [PATCH 25/32] #475 --- azure-pipelines.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8b080ea2..78a49ded 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -98,16 +98,9 @@ stages: echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" name: set_zipname_value - - - bash: | - echo "$ZIPNAME" - echo $ZIPNAME - echo $zipName - - name: set_zipname_variable - bash: | - echo zipName - $(zipName) + echo "zipName - $(zipName)" name: display_zipname_value # - script: | From ce8d0eedc367c1fd882f702561e6eea156ca4fc2 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:34:23 +0200 Subject: [PATCH 26/32] #475 --- azure-pipelines.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 78a49ded..702244fe 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -78,11 +78,9 @@ stages: if [ "$(isProd)" = "True" ]; then echo isProd - $(isProd) ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" - elif [ "$(isQA)" = "True" ]; then echo isQA - $(isQA) ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" - elif [ "$(isDebug)" = "True" ]; then echo isDebug - $(isDebug) TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" @@ -93,7 +91,6 @@ stages: echo isDebug - $(isDebug) ZIPNAME="$(NAME)" fi - echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" From 19bed837a18959417ad2d6911958aff52cc68c16 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:44:46 +0200 Subject: [PATCH 27/32] #475 --- azure-pipelines.yml | 175 +++++++++++++++++++++++++++++--------------- 1 file changed, 114 insertions(+), 61 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 702244fe..9500dc4c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,69 +36,122 @@ variables: # -- STAGES ---------------------------------------------------------------------------------------- stages: -- stage: variables_report +# - stage: variables_report +# pool: +# vmImage: "windows-2019" +# displayName: "Variables values" +# jobs: +# # -- LINT AND FORMAT ----------------------------------------------------------------------------- +# - job: show_variables_values +# displayName: "Pipeline variables values" + +# steps: +# - checkout: none +# - script: | +# echo NAME - $(NAME) +# echo Build.BuildId - $(Build.BuildId) +# echo Build.SourceBranch - $(Build.SourceBranch) +# echo System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory) +# echo pythonVersion - $(pythonVersion) +# echo isProd - $(isProd) +# echo isQA - $(isQA) +# echo isDebug - $(isDebug) +# echo releaseDate - $(releaseDate) +# echo releaseDateWithHour - $(releaseDateWithHour) +- stage: variables pool: - vmImage: "windows-2019" - displayName: "Variables values" + vmImage: "ubuntu-latest" + displayName: "Setting and displaying variables values" jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - - job: show_variables_values - displayName: "Pipeline variables values" + - job: variables_values + # displayName: "Pipeline variables values" steps: - - checkout: none - - script: | - echo NAME - $(NAME) - echo Build.BuildId - $(Build.BuildId) - echo Build.SourceBranch - $(Build.SourceBranch) - echo System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory) - echo pythonVersion - $(pythonVersion) - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - echo releaseDate - $(releaseDate) - echo releaseDateWithHour - $(releaseDateWithHour) - -- stage : build_zipname - pool: - vmImage: "ubuntu-latest" - # vmImage: "windows-2019" - displayName: "Build ZIP name" - dependsOn : variables_report - condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) - jobs: - # -- CREATE zipName ----------------------------------------------------------------------------- - - job: create_zipname_variable - displayName: "Execute cmd script to set 'zipName' variable" - steps: - - checkout : self - fetchTags: True - - - bash: | - if [ "$(isProd)" = "True" ]; then - echo isProd - $(isProd) - ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" - elif [ "$(isQA)" = "True" ]; then - echo isQA - $(isQA) - ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" - elif [ "$(isDebug)" = "True" ]; then - echo isDebug - $(isDebug) - TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" - ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" - else - echo isProd - $(isProd) - echo isQA - $(isQA) - echo isDebug - $(isDebug) - ZIPNAME="$(NAME)" - fi - echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" - echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" - - name: set_zipname_value + - checkout : self + fetchTags: True + + - bash: | + if [ "$(isProd)" = "True" ]; then + echo isProd - $(isProd) + ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" + elif [ "$(isQA)" = "True" ]; then + echo isQA - $(isQA) + ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" + elif [ "$(isDebug)" = "True" ]; then + echo isDebug - $(isDebug) + TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" + ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" + else + echo isProd - $(isProd) + echo isQA - $(isQA) + echo isDebug - $(isDebug) + ZIPNAME="$(NAME)" + fi + echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" + echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" + + name: set_zipname_variable + + # - bash: | + # echo "zipName - $(zipName)" + # name: display_zipname_value + + - bash: | + echo "NAME - $(NAME)" + echo "Build.BuildId - $(Build.BuildId)" + echo "Build.SourceBranch - $(Build.SourceBranch)" + echo "System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory)" + echo "pythonVersion - $(pythonVersion)" + echo "isProd - $(isProd)" + echo "isQA - $(isQA)" + echo "isDebug - $(isDebug)" + echo "releaseDate - $(releaseDate)" + echo "releaseDateWithHour - $(releaseDateWithHour)" + echo "zipName - $(zipName)" + + name: display_variables_values + +# - stage : build_zipname +# pool: +# vmImage: "ubuntu-latest" +# # vmImage: "windows-2019" +# displayName: "Build ZIP name" +# dependsOn : variables_report +# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) +# jobs: +# # -- CREATE zipName ----------------------------------------------------------------------------- +# - job: create_zipname_variable +# displayName: "Execute cmd script to set 'zipName' variable" +# steps: +# - checkout : self +# fetchTags: True + +# - bash: | +# if [ "$(isProd)" = "True" ]; then +# echo isProd - $(isProd) +# ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" +# elif [ "$(isQA)" = "True" ]; then +# echo isQA - $(isQA) +# ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" +# elif [ "$(isDebug)" = "True" ]; then +# echo isDebug - $(isDebug) +# TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" +# ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" +# else +# echo isProd - $(isProd) +# echo isQA - $(isQA) +# echo isDebug - $(isDebug) +# ZIPNAME="$(NAME)" +# fi +# echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" +# echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" + +# name: set_zipname_variable - - bash: | - echo "zipName - $(zipName)" - name: display_zipname_value +# - bash: | +# echo "zipName - $(zipName)" +# name: display_zipname_value # - script: | # echo isProd - $(isProd) @@ -135,10 +188,10 @@ stages: - stage: integration pool: vmImage: "windows-2019" - dependsOn : build_zipname + dependsOn : variables condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) variables: - zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] displayName: "Integration" jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- @@ -227,7 +280,7 @@ stages: - integration - build_zipname variables: - zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] displayName: "Upload packaged plugin to Blob Storage" jobs: - template : /on-premises/upload_to_blob.yml@templates @@ -256,7 +309,7 @@ stages: - integration - build_zipname variables: - zipName: $[ stageDependencies.build_zipname.create_zipname_variable.outputs['set_zipname_variable.zipName'] ] + zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] condition: and(succeeded(), eq(variables.isProd, true)) jobs: From 022aacca1ae173f94de98aa0aedee24e66a16d75 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 13:47:22 +0200 Subject: [PATCH 28/32] #475 --- azure-pipelines.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9500dc4c..bc512fe9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -112,7 +112,7 @@ stages: name: display_variables_values -# - stage : build_zipname +# - stage : variables # pool: # vmImage: "ubuntu-latest" # # vmImage: "windows-2019" @@ -278,7 +278,7 @@ stages: condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) dependsOn : - integration - - build_zipname + - variables variables: zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] displayName: "Upload packaged plugin to Blob Storage" @@ -307,7 +307,7 @@ stages: displayName: "Create a GitHub release for tag ${{ variables.tagName }}" dependsOn: - integration - - build_zipname + - variables variables: zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] condition: and(succeeded(), eq(variables.isProd, true)) From 788a3a2bbe05e3542c500ab0cf572756e451fe0d Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 18:21:55 +0200 Subject: [PATCH 29/32] #475 --- azure-pipelines.yml | 114 ++++---------------------------------------- 1 file changed, 10 insertions(+), 104 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bc512fe9..fed13642 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -36,35 +36,14 @@ variables: # -- STAGES ---------------------------------------------------------------------------------------- stages: -# - stage: variables_report -# pool: -# vmImage: "windows-2019" -# displayName: "Variables values" -# jobs: -# # -- LINT AND FORMAT ----------------------------------------------------------------------------- -# - job: show_variables_values -# displayName: "Pipeline variables values" - -# steps: -# - checkout: none -# - script: | -# echo NAME - $(NAME) -# echo Build.BuildId - $(Build.BuildId) -# echo Build.SourceBranch - $(Build.SourceBranch) -# echo System.DefaultWorkingDirectory - $(System.DefaultWorkingDirectory) -# echo pythonVersion - $(pythonVersion) -# echo isProd - $(isProd) -# echo isQA - $(isQA) -# echo isDebug - $(isDebug) -# echo releaseDate - $(releaseDate) -# echo releaseDateWithHour - $(releaseDateWithHour) - stage: variables pool: - vmImage: "ubuntu-latest" - displayName: "Setting and displaying variables values" + vmImage: "ubuntu-22.04" + displayName: "Variables" jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - job: variables_values + displayName: "Setting and displaying variables values" # displayName: "Pipeline variables values" steps: @@ -88,14 +67,12 @@ stages: echo isDebug - $(isDebug) ZIPNAME="$(NAME)" fi + + echo $ZIPNAME echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" name: set_zipname_variable - - # - bash: | - # echo "zipName - $(zipName)" - # name: display_zipname_value - bash: | echo "NAME - $(NAME)" @@ -112,79 +89,6 @@ stages: name: display_variables_values -# - stage : variables -# pool: -# vmImage: "ubuntu-latest" -# # vmImage: "windows-2019" -# displayName: "Build ZIP name" -# dependsOn : variables_report -# condition: and(succeeded(), or(eq(variables.isProd, true), eq(variables.isQA, true), eq(variables.isDebug, true))) -# jobs: -# # -- CREATE zipName ----------------------------------------------------------------------------- -# - job: create_zipname_variable -# displayName: "Execute cmd script to set 'zipName' variable" -# steps: -# - checkout : self -# fetchTags: True - -# - bash: | -# if [ "$(isProd)" = "True" ]; then -# echo isProd - $(isProd) -# ZIPNAME="$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||')" -# elif [ "$(isQA)" = "True" ]; then -# echo isQA - $(isQA) -# ZIPNAME="$(NAME)-qa-$(releaseDateWithHour)" -# elif [ "$(isDebug)" = "True" ]; then -# echo isDebug - $(isDebug) -# TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" -# ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" -# else -# echo isProd - $(isProd) -# echo isQA - $(isQA) -# echo isDebug - $(isDebug) -# ZIPNAME="$(NAME)" -# fi -# echo "##vso[task.setvariable variable=zipName;]$ZIPNAME" -# echo "##vso[task.setvariable variable=zipName;isOutput=true]$ZIPNAME" - -# name: set_zipname_variable - -# - bash: | -# echo "zipName - $(zipName)" -# name: display_zipname_value - - # - script: | - # echo isProd - $(isProd) - # echo isQA - $(isQA) - # echo isDebug - $(isDebug) - - # if [ "$(isProd)" = "True" ]; then - # echo isProd - %isProd% - # set ZIPNAME=$(NAME)-$(echo $(Build.SourceBranch) | sed 's|refs/tags/||') - - # if [ "$(isQA)" = "True" ]; then - # echo isQA - %isQA% - # set ZIPNAME=$(NAME)-qa-$(releaseDateWithHour) - - # if [ "$(isDebug)" = "True" ]; then - # echo isDebug - %isDebug% - # git rev-list --tags --max-count=1 - # for /f "tokens=* USEBACKQ" %%a in (`git rev-list --tags --max-count=1`) do SET COMMIT=%%a & $(COMMIT) - # echo COMMIT - %COMMIT% - # git describe --tags %COMMIT% - # for /f "tokens=* USEBACKQ" %%b in (`git describe --tags %COMMIT%`) do SET TAG=%%b - # echo TAG: %TAG% - # set ZIPNAME=$(NAME)-debug-%TAG%-$(releaseDate) - - # echo %ZIPNAME% - - # echo ##vso[task.setvariable variable=zipName]%ZIPNAME% - # echo ##vso[task.setvariable variable=zipName;isOutput=true]%ZIPNAME% - - # echo $(zipName) - - # name: set_zipname_variable - - stage: integration pool: vmImage: "windows-2019" @@ -281,7 +185,7 @@ stages: - variables variables: zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] - displayName: "Upload packaged plugin to Blob Storage" + displayName: "Upload to Blob" jobs: - template : /on-premises/upload_to_blob.yml@templates parameters : @@ -292,22 +196,23 @@ stages: condition: and(succeeded(), eq(variables.isProd, true)) dependsOn : - upload_to_blob - displayName: "Add new plugin version to versions.json file" + displayName: "Update versions.json" jobs: - template : /on-premises/update_versions.yml@templates - stage: installer_tag condition: and(succeeded(), eq(variables.isProd, true)) dependsOn: versions_update + displayName: "git tag installer" jobs : - template : /on-premises/retrieve_github_pat.yml@templates - template : /on-premises/installer_tag.yml@templates - stage: publish_to_github - displayName: "Create a GitHub release for tag ${{ variables.tagName }}" dependsOn: - integration - variables + displayName: "GitHub release" variables: zipName: $[ stageDependencies.variables.variables_values.outputs['set_zipname_variable.zipName'] ] condition: and(succeeded(), eq(variables.isProd, true)) @@ -315,6 +220,7 @@ stages: jobs: - job: 'create_github_release' + displayName: "Create a GitHub release for tag ${{ variables.tagName }}" steps: - checkout: none From 62f32b20bf7e0e8856c3792c4b1d19d869ff44c7 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 18:42:27 +0200 Subject: [PATCH 30/32] #475 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index fed13642..ee93d233 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -60,7 +60,7 @@ stages: elif [ "$(isDebug)" = "True" ]; then echo isDebug - $(isDebug) TAG="$(git describe --tags $(git rev-list --tags --max-count=1))" - ZIPNAME="$(NAME)-debug-$(TAG)-$(releaseDate)" + ZIPNAME="$(NAME)-debug-$TAG-$(releaseDate)" else echo isProd - $(isProd) echo isQA - $(isQA) From e5c0cf65aae798cfce58bd6c5ebedfc842954962 Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Tue, 16 Apr 2024 19:05:05 +0200 Subject: [PATCH 31/32] #475 --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ee93d233..0a453089 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -229,7 +229,7 @@ stages: displayName: "Download packaged source code saved during 'integration' stage" inputs: buildType: "current" - artifactName: $(zipName).zip + artifactName: $(zipName) targetPath: "$(System.DefaultWorkingDirectory)" - task: GitHubRelease@1 From 00edc3085ebc377a64772d39f4cf603191d4b4af Mon Sep 17 00:00:00 2001 From: SimonSAMPERE Date: Wed, 17 Apr 2024 10:25:42 +0200 Subject: [PATCH 32/32] #475 --- azure-pipelines.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0a453089..f2f8a06d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,7 +43,7 @@ stages: jobs: # -- LINT AND FORMAT ----------------------------------------------------------------------------- - job: variables_values - displayName: "Setting and displaying variables values" + displayName: "Set and display variables values" # displayName: "Pipeline variables values" steps: @@ -106,9 +106,6 @@ stages: - checkout: self fetchDepth: 10 - - script: | - echo zipName - $(zipName).zip - - task: UsePythonVersion@0 inputs: versionSpec: $(pythonVersion) @@ -158,7 +155,7 @@ stages: displayName: "Package - script ./tools/plugin_packager.py" - task: PublishPipelineArtifact@1 - displayName: "Publish pipeline artifact: plugin packaged" + displayName: "Publish - pipeline artifact" inputs: path: $(System.DefaultWorkingDirectory)/build/latest/isogeo_search_engine.zip artifact: $(zipName) @@ -168,10 +165,10 @@ stages: ls $(System.DefaultWorkingDirectory)\build\latest\ mv $(System.DefaultWorkingDirectory)\build\latest\isogeo_search_engine.zip $(System.DefaultWorkingDirectory)\build\latest\$(zipName).zip ls $(System.DefaultWorkingDirectory)\build\latest\ - displayName: "Package - rename archive for on premises artifact" + displayName: "Package - rename archive to ${{ variables.zipName }}" - task: PublishBuildArtifacts@1 - displayName: "Publish build artifact: plugin packaged for on premises" + displayName: "Publish - build artifact" inputs: PathtoPublish: $(System.DefaultWorkingDirectory)/build/latest/$(zipName).zip ArtifactName: archive @@ -203,7 +200,7 @@ stages: - stage: installer_tag condition: and(succeeded(), eq(variables.isProd, true)) dependsOn: versions_update - displayName: "git tag installer" + displayName: "Git tag installer" jobs : - template : /on-premises/retrieve_github_pat.yml@templates - template : /on-premises/installer_tag.yml@templates @@ -220,7 +217,7 @@ stages: jobs: - job: 'create_github_release' - displayName: "Create a GitHub release for tag ${{ variables.tagName }}" + displayName: "Create a GitHub Release" steps: - checkout: none