mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
[FAB-16850] Set up CI with Azure Pipelines
Signed-off-by: Simon Stone <sstone1@uk.ibm.com> Change-Id: I3821a329ec5eb439ce0f27cfbc71b28e6b0b8a09
This commit is contained in:
parent
81aabf4c0b
commit
fe96f60311
7 changed files with 150 additions and 0 deletions
51
ci/azure-pipelines.yml
Normal file
51
ci/azure-pipelines.yml
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
trigger:
|
||||
- master
|
||||
- release-1.4
|
||||
|
||||
jobs:
|
||||
- job: fabcar_go
|
||||
displayName: FabCar (Go)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-go.yml
|
||||
- job: fabcar_java
|
||||
displayName: FabCar (Java)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-java.yml
|
||||
- job: fabcar_javascript
|
||||
displayName: FabCar (JavaScript)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-javascript.yml
|
||||
- job: fabcar_typescript
|
||||
displayName: FabCar (TypeScript)
|
||||
pool:
|
||||
vmImage: ubuntu-18.04
|
||||
dependsOn: []
|
||||
timeoutInMinutes: 60
|
||||
steps:
|
||||
- template: install-deps.yml
|
||||
- template: install-fabric.yml
|
||||
- template: fabcar-typescript.yml
|
||||
|
||||
|
||||
8
ci/fabcar-go.yml
Normal file
8
ci/fabcar-go.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh go
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
14
ci/fabcar-java.yml
Normal file
14
ci/fabcar-java.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh java
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- mvn dependency:go-offline
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: mvn test
|
||||
workingDirectory: fabcar/java
|
||||
displayName: Run FabCar application
|
||||
19
ci/fabcar-javascript.yml
Normal file
19
ci/fabcar-javascript.yml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh javascript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- npm install
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: |
|
||||
set -ex
|
||||
node enrollAdmin
|
||||
node registerUser
|
||||
node invoke
|
||||
node query
|
||||
workingDirectory: fabcar/javascript
|
||||
displayName: Run FabCar application
|
||||
22
ci/fabcar-typescript.yml
Normal file
22
ci/fabcar-typescript.yml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: bash startFabric.sh typescript
|
||||
workingDirectory: fabcar
|
||||
displayName: Start Fabric
|
||||
- script: retry -- npm install
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Install FabCar application dependencies
|
||||
- script: npm run build
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Build FabCar application
|
||||
- script: |
|
||||
set -ex
|
||||
node dist/enrollAdmin
|
||||
node dist/registerUser
|
||||
node dist/invoke
|
||||
node dist/query
|
||||
workingDirectory: fabcar/typescript
|
||||
displayName: Run FabCar application
|
||||
7
ci/install-deps.yml
Normal file
7
ci/install-deps.yml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry"
|
||||
displayName: Install retry CLI
|
||||
29
ci/install-fabric.yml
Normal file
29
ci/install-fabric.yml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
steps:
|
||||
- script: |
|
||||
set -ex
|
||||
mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric:hyperledger-fabric-latest:linux-amd64.latest-SNAPSHOT:tar.gz
|
||||
mvn dependency:copy -Dartifact=org.hyperledger.fabric:hyperledger-fabric-latest:linux-amd64.latest-SNAPSHOT:tar.gz -DoutputDirectory=/tmp
|
||||
cd /usr/local
|
||||
sudo tar xzvf /tmp/hyperledger-fabric-latest-linux-amd64.latest-SNAPSHOT.tar.gz
|
||||
displayName: Download Fabric CLI
|
||||
- script: |
|
||||
set -ex
|
||||
mvn dependency:get -DremoteRepositories=https://nexus.hyperledger.org/content/repositories/snapshots -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-latest:linux-amd64.latest-SNAPSHOT:tar.gz
|
||||
mvn dependency:copy -Dartifact=org.hyperledger.fabric-ca:hyperledger-fabric-ca-latest:linux-amd64.latest-SNAPSHOT:tar.gz -DoutputDirectory=/tmp
|
||||
cd /usr/local
|
||||
sudo tar xzvf /tmp/hyperledger-fabric-ca-latest-linux-amd64.latest-SNAPSHOT.tar.gz
|
||||
displayName: Download Fabric CA CLI
|
||||
- script: |
|
||||
set -ex
|
||||
for i in baseos ca ccenv javaenv nodeenv peer orderer tools; do
|
||||
docker pull nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:amd64-2.0.0-stable
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:amd64-2.0.0
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:2.0.0
|
||||
docker tag nexus3.hyperledger.org:10001/hyperledger/fabric-$i:amd64-2.0.0-stable hyperledger/fabric-$i:latest
|
||||
done
|
||||
displayName: Pull Fabric Docker images
|
||||
Loading…
Reference in a new issue