Skip to content

Commit

Permalink
[FAB-16850] Set up CI with Azure Pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Stone <sstone1@uk.ibm.com>
Change-Id: I3821a329ec5eb439ce0f27cfbc71b28e6b0b8a09
  • Loading branch information
Simon Stone committed Oct 17, 2019
1 parent 81aabf4 commit fe96f60
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 0 deletions.
51 changes: 51 additions & 0 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 8 additions & 0 deletions ci/fabcar-go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# SPDX-License-Identifier: Apache-2.0
#

steps:
- script: bash startFabric.sh go
workingDirectory: fabcar
displayName: Start Fabric
14 changes: 14 additions & 0 deletions ci/fabcar-java.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 19 additions & 0 deletions ci/fabcar-javascript.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 22 additions & 0 deletions ci/fabcar-typescript.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions ci/install-deps.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 29 additions & 0 deletions ci/install-fabric.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit fe96f60

Please sign in to comment.