Skip to content

Commit

Permalink
Automate build/publish of Eclipse Che packages (contributes to IBM-Bl…
Browse files Browse the repository at this point in the history
…ockchain#1071)

Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
  • Loading branch information
Simon Stone committed Jan 17, 2020
1 parent dbd0df1 commit 83b4e49
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
34 changes: 33 additions & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,38 @@ 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:
- unitTest
- cucumberTest
- cypressTest
- buildPackage
- buildChePackage
jobs:
- job:
pool:
Expand All @@ -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)
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions che/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOF
cat > ibm-blockchain-platform-che-${VERSION}.yaml <<EOF
#
# SPDX-License-Identifier: Apache-2.0
#
Expand All @@ -57,5 +57,5 @@ category: Other
firstPublicationDate: 2019-04-19
spec:
extensions:
- https://github.com/IBM-Blockchain/blockchain-vscode-extension/releases/download/v${VERSION}/ibm-blockchain-platform-che.vsix
- https://github.com/IBM-Blockchain/blockchain-vscode-extension/releases/download/v${VERSION}/ibm-blockchain-platform-che-${VERSION}.vsix
EOF

0 comments on commit 83b4e49

Please sign in to comment.