Skip to content

Commit

Permalink
[FAB-16711] Azure pipelines
Browse files Browse the repository at this point in the history
Change-Id: I82b21c75b9c538ab8aef859c90e32941084a98e6
Signed-off-by: Matthew B. White <whitemat@uk.ibm.com>
  • Loading branch information
mbwhite committed Oct 22, 2019
1 parent d90bdfd commit 24afd25
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
# fabric-chaincode-node azure pipeline configuration.
#
name: RELEASE-$(Date:yyyyMMdd)$(Rev:.rrr)

trigger:
branches:
include:
- 'master'
- 'release-1.4'
tags:
include:
- '*'

# These are custom defined variables, the pipeline one is currently used for the build scripts
# to know to produce tests results in XML format for Azure to consume, for developers
# this isn't set so command line output is given
#
variables:
- group: Chaincode_Node_Vars
component: fabric-chaincode-node
pipeline: ci

# Build on Ubutu
pool:
vmImage: 'ubuntu-latest'

#
# The stages and jobs, potential for rationalization and optimization
# Keeping it simple and explict whilst we gain experience
stages:
- stage: Build_and_Test
jobs:
- job: main
displayName: 'Build, lint, UT'
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
- script: |
node common/scripts/install-run-rush.js install
node common/scripts/install-run-rush.js update
displayName: 'Setup the node environment'
- script: |
node common/scripts/install-run-rush.js rebuild
displayName: 'Full rebuild'
- task: PublishTestResults@2
condition: or(succeeded(), failed()) # publish either way
inputs:
testResultsFiles: '**/test-results.xml'
artifactName: 'Unit Test results'
testRunTitle: 'Unit Test results'
- task: PublishCodeCoverageResults@1
condition: or(succeeded(), failed()) # publish either way
inputs:
codeCoverageTool: 'cobertura'
summaryFileLocation: '**/cobertura-coverage.xml'
artifactName: 'Unit Test Coverage'
- script: |
node common/scripts/install-run-rush.js publish --include-all --pack --release-folder $(Build.ArtifactStagingDirectory)/tgz --publish
displayName: 'Package as tgz'
- job: fvt
displayName: 'FV Tests'
dependsOn: main
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
- script: |
node common/scripts/install-run-rush.js install
node common/scripts/install-run-rush.js update
node common/scripts/install-run-rush.js rebuild # replace this with pull from the artifacts staging
displayName: 'Setup the node environment'
- script: |
node common/scripts/install-run-rush.js start-fabric
node common/scripts/install-run-rush.js start-verdaccio
docker images | grep hyperledger && docker ps -a
node common/scripts/install-run-rush.js test:fv
node common/scripts/install-run-rush.js test:e2e
displayName: 'FV Tests'
- task: PublishTestResults@2
condition: or(succeeded(), failed()) # publish either way
inputs:
testResultsFiles: '**/test-results.xml'
artifactName: 'FV Test results'
testRunTitle: 'FV Test results'
- job: apidocs
steps:
- task: NodeTool@0
inputs:
versionSpec: '8.x'
- script: |
npm install
npm install -g gulp-cli
displayName: 'Setup the node environment'
- script: |
gulp docs
displayName: 'Produce API docs'
- publish: $(System.DefaultWorkingDirectory)/docs/gen/
artifact: 'jsdocs'
- stage: Publish_tag
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
jobs:
- job: update_version
steps:
- script: |
env | sort
echo "Update the version number"
echo "Make sure release notes are present"
echo "Make sure change history is present"
- job: npm_publish
steps:
- script: |
echo "Setup .npmrc"
echo "Use pipeline secret to login"
echo "publish"
- job: jsdoc_publish
steps:
- script: |
echo "checkout docs branch"
echo "checking"

0 comments on commit 24afd25

Please sign in to comment.