forked from hyperledger/fabric-sdk-node
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
99 lines (91 loc) · 3.09 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
# Pipeline-level keywords belong here
trigger:
- master
pr:
- master
pool:
vmImage: 'ubuntu-18.04'
variables:
- group: credentials
- group: npm
- name: SOFTHSM2_CONF
value: $(Build.Repository.LocalPath)/test/ts-fixtures/hsm/softhsm2.conf
- name: FABRIC_VERSION
value: 2.1
# A Pipeline contains one or more stages
# A stage is a related collection of jobs. By default stages run sequentially
# A job is a collection of steps run by an agent or server
stages:
- stage: SetupRunTests
displayName: Setup and Run Tests
jobs:
- job: SetupRunTests
displayName: Install Node.js and run tests on
strategy:
matrix:
Node10:
versionSpec: '10.x'
Node12:
versionSpec: '12.x'
steps:
- task: NodeTool@0
inputs:
versionSpec: "$(versionSpec)"
displayName: Install Node.js
- script: |
sudo apt-get install softhsm2
softhsm2-util --init-token --slot 0 --label "ForFabric" --pin 98765432 --so-pin 1234
displayName: Install SoftHSM
- script: npm install
displayName: npm install
- script: npm run installAndGenerateCerts
displayName: Generate credentials
- script: npm run pullFabricImages
displayName: Pull Fabric Images
- script: npm test
displayName: Run tests
- stage: Publish
displayName: Publish Packages and Docs
jobs:
- job: PublishPackages
displayName: Publish npm packages
condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI'))
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: Install Node.js
- script: npm install
displayName: npm install
- script: npm run compile
displayName: Compile
- script: scripts/ci_scripts/azurePublishNpmPackages.sh
displayName: Publish packages
env:
NPM_TOKEN: "$(NPM)"
PROJECT_DIR: "$(Build.Repository.LocalPath)"
- job: PublishDocs
displayName: Publish API documentation
condition: and(succeeded(), eq(variables['Build.Reason'], 'IndividualCI'))
steps:
- task: NodeTool@0
inputs:
versionSpec: '12.x'
displayName: Install Node.js
- script: npm install
displayName: npm install
- script: npm run compile
displayName: Compile
- script: scripts/ci_scripts/azurePublishApiDocs.sh
displayName: Publish API docs
env:
GITHUB_USER: 'Hyperledger Bot'
GITHUB_EMAIL: 'hlfdev.azp@gmail.com'
PUBLISH_URL: "https://$(GITHUB-PAT)@github.com/hyperledger/fabric-sdk-node.git"
PROJECT_DIR: "$(Build.Repository.LocalPath)"
STAGING_DIR: "$(Build.StagingDirectory)/gh-pages"
SOURCE_BRANCH: "$(Build.SourceBranchName)"