From 83b4e493e03cdc27444fde255151b9a2600d1f90 Mon Sep 17 00:00:00 2001 From: Simon Stone Date: Fri, 17 Jan 2020 12:58:30 +0000 Subject: [PATCH] Automate build/publish of Eclipse Che packages (contributes to #1071) Signed-off-by: Simon Stone --- azure-pipelines.yml | 34 +++++++++++++++++++++++++++++++++- che/build.sh | 6 +++--- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 06e0f04e2b..e3961abe87 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -141,6 +141,30 @@ stages: pathtoPublish: '$(Build.ArtifactStagingDirectory)' artifactName: vscode-package + - stage: buildChePackage + dependsOn: + - unitTest + - cucumberTest + - cypressTest + jobs: + - job: buildChePackage + pool: + vmImage: ubuntu-16.04 + steps: + - script: che/build.sh + displayName: Build Che package + - task: CopyFiles@2 + inputs: + sourceFolder: '$(Build.SourcesDirectory)/che' + contents: | + *.vsix + *.yaml + targetFolder: '$(Build.ArtifactStagingDirectory)' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: '$(Build.ArtifactStagingDirectory)' + artifactName: vscode-che-package + - stage: deploy condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags')) dependsOn: @@ -148,6 +172,7 @@ stages: - cucumberTest - cypressTest - buildPackage + - buildChePackage jobs: - job: pool: @@ -158,6 +183,11 @@ stages: artifact: vscode-package path: $(Build.SourcesDirectory) + - task: DownloadPipelineArtifact@2 + inputs: + artifact: vscode-che-package + path: $(Build.SourcesDirectory) + - bash: | set -ev export tag=$(git tag --sort=-creatordate | head -n 1) @@ -174,7 +204,9 @@ stages: assetUploadMode: 'replace' isPreRelease: true addChangeLog: false - assets: '$(Build.SourcesDirectory)/*.vsix' + assets: | + $(Build.SourcesDirectory)/ibm-blockchain-platform-*.vsix + $(Build.SourcesDirectory)/ibm-blockchain-platform-*.yaml - bash: | set -ev diff --git a/che/build.sh b/che/build.sh index 5dfec523d1..381148c645 100755 --- a/che/build.sh +++ b/che/build.sh @@ -35,10 +35,10 @@ cat package.json.orig \ npm rebuild --update-binary --runtime=node --target=10.0.0 --target_platform=linux --target_arch=x64 --target_libc=musl npm run package cd ${ROOT} -mv ./packages/blockchain-extension/ibm-blockchain-platform-*.vsix che/ibm-blockchain-platform-che.vsix export VERSION=$(jq -r .version lerna.json) +mv ./packages/blockchain-extension/ibm-blockchain-platform-${VERSION}.vsix che/ibm-blockchain-platform-che-${VERSION}.vsix cd che -cat > ibm-blockchain-platform-che.yaml < ibm-blockchain-platform-che-${VERSION}.yaml <