From 8e421233a8f23e4fcb68ee73b2452ee1c47f2d68 Mon Sep 17 00:00:00 2001 From: Joao Almeida Date: Wed, 1 Apr 2020 18:21:11 +0100 Subject: [PATCH] added prod env --- .../pipeline-triggerer-extension-CICD.yaml | 57 ++++++++----------- .pipelines/template-release.yaml | 45 +++++++++++++++ 2 files changed, 69 insertions(+), 33 deletions(-) create mode 100644 .pipelines/template-release.yaml diff --git a/.pipelines/pipeline-triggerer-extension-CICD.yaml b/.pipelines/pipeline-triggerer-extension-CICD.yaml index 66e157f..2f6c64b 100644 --- a/.pipelines/pipeline-triggerer-extension-CICD.yaml +++ b/.pipelines/pipeline-triggerer-extension-CICD.yaml @@ -88,7 +88,7 @@ stages: displayName: 'Publish artifacts: extension' artifact: $(artifactName) -- stage: Publish_Ext +- stage: Publish_Ext_Dev displayName: DEV dependsOn: Build_Ext condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) @@ -99,38 +99,29 @@ stages: vmImage: 'ubuntu-latest' steps: - - download: current - artifact: $(artifactName) - patterns: '**/*' + - template: template-release.yaml + parameters: + publisherId: $(publisherId) + projName: $(projName) + marketplaceServiceConnection: $(vsMarketplaceServiceConnetion) + artifactName: $(artifactName) + # extensionVisibility: private - - task: ms-devlabs.vsts-developer-tools-build-tasks.tfx-installer-build-task.TfxInstaller@1 - displayName: 'Use Node CLI for Azure DevOps: v0.7.3' - inputs: - version: v0.7.3 - enabled: false +- stage: Publish_Ext_Prod + displayName: PROD + dependsOn: Build_Ext + condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master')) + jobs: + - job: PublishExt + displayName: Publish Extension + pool: + vmImage: 'ubuntu-latest' - - task: ms-devlabs.vsts-developer-tools-build-tasks.extension-version-build-task.ExtensionVersion@1 - displayName: 'Query Extension Version' - inputs: - connectedServiceName: '$(vsMarketplaceServiceConnetion)' - publisherId: $(publisherId) - extensionId: $(projName) - - task: ms-devlabs.vsts-developer-tools-build-tasks.publish-extension-build-task.PublishExtension@1 - displayName: 'Publish Extension' - inputs: - connectedServiceName: '$(vsMarketplaceServiceConnetion)' - fileType: vsix - vsixFile: '$(Pipeline.Workspace)/$(artifactName)/$(publisherId).$(projName)-*.vsix' + steps: + - template: template-release.yaml + parameters: publisherId: $(publisherId) - extensionName: 'Azure DevOps Pipeline Triggerer Extension' - updateTasksVersion: false - extensionVisibility: private - extensionPricing: free - outputVariable: ExtensionOutputPath - - task: ms-devlabs.vsts-developer-tools-build-tasks.share-extension-build-task.ShareExtension@1 - displayName: 'Share Extension' - inputs: - connectedServiceName: '$(vsMarketplaceServiceConnetion)' - method: vsix - vsixFile: '$(Pipeline.Workspace)/$(artifactName)/$(publisherId).$(projName)-*.vsix' - accounts: $(publisherId) \ No newline at end of file + projName: $(projName) + marketplaceServiceConnection: $(vsMarketplaceServiceConnetion) + artifactName: $(artifactName) + extensionVisibility: public diff --git a/.pipelines/template-release.yaml b/.pipelines/template-release.yaml new file mode 100644 index 0000000..0d55dee --- /dev/null +++ b/.pipelines/template-release.yaml @@ -0,0 +1,45 @@ +parameters: + publisherId: # Published Id @ https://marketplace.visualstudio.com/manage + projName: # Required: Extension Name + marketplaceServiceConnection: # Required: Service connection for Visual Studio Marketplace + artifactName: 'extension-artifact' # Artifact name + extensionVisibility: private + +steps: + - download: current + artifact: ${{parameters.artifactName}} + patterns: '**/*' + + - task: ms-devlabs.vsts-developer-tools-build-tasks.tfx-installer-build-task.TfxInstaller@1 + displayName: 'Use Node CLI for Azure DevOps: v0.7.3' + inputs: + version: v0.7.3 + enabled: false + + - task: ms-devlabs.vsts-developer-tools-build-tasks.extension-version-build-task.ExtensionVersion@1 + displayName: 'Query Extension Version' + inputs: + connectedServiceName: ${{parameters.marketplaceServiceConnection}} + publisherId: ${{parameters.publisherId}} + extensionId: ${{parameters.projName}} + + - task: ms-devlabs.vsts-developer-tools-build-tasks.publish-extension-build-task.PublishExtension@1 + displayName: 'Publish Extension' + inputs: + connectedServiceName: ${{parameters.marketplaceServiceConnection}} + fileType: vsix + vsixFile: '$(Pipeline.Workspace)/${{parameters.artifactName}}/${{parameters.publisherId}}.${{parameters.projName}}-*.vsix' + publisherId: ${{parameters.publisherId}} + extensionName: 'Azure DevOps Pipeline Triggerer Extension' + updateTasksVersion: false + extensionVisibility: ${{parameters.extensionVisibility}} + extensionPricing: free + outputVariable: ExtensionOutputPath + + - task: ms-devlabs.vsts-developer-tools-build-tasks.share-extension-build-task.ShareExtension@1 + displayName: 'Share Extension' + inputs: + connectedServiceName: ${{parameters.marketplaceServiceConnection}} + method: vsix + vsixFile: '$(Pipeline.Workspace)/${{parameters.artifactName}}/${{parameters.publisherId}}.${{parameters.projName}}-*.vsix' + accounts: ${{parameters.publisherId}} \ No newline at end of file