Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organize and Standardize ci Directory Content #152

Merged
merged 1 commit into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 35 additions & 58 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,94 +7,71 @@ trigger:
- release-1.4

variables:
NODE_VER: '12.x'
PATH: $(Agent.BuildDirectory)/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
FABRIC_VERSION: 2.0
NODE_VER: 12.x
PATH: $(Build.Repository.LocalPath)/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin

jobs:
- job: fabcar_go
displayName: FabCar (Go)
- job: CommercialPaper_Go
displayName: Commercial Paper (Go)
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: fabcar-go.yml
- template: templates/install-deps.yml
- template: templates/commercial-paper/azure-pipelines-go.yml

- job: test_network
displayName: Start the test network
- job: CommercialPaper_Java
displayName: Commercial Paper (Java)
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: testnetwork.yml
- template: templates/install-deps.yml
- template: templates/commercial-paper/azure-pipelines-java.yml

- job: fabcar_java
displayName: FabCar (Java)
- job: CommercialPaper_JavaScript
displayName: Commercial Paper (JavaScript)
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: fabcar-java.yml
- template: templates/install-deps.yml
- template: templates/commercial-paper/azure-pipelines-javascript.yml

- job: fabcar_javascript
displayName: FabCar (JavaScript)
- 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-javascript.yml
- template: templates/install-deps.yml
- template: templates/fabcar/azure-pipelines-go.yml

- job: fabcar_typescript
displayName: FabCar (TypeScript)
- 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-typescript.yml
- template: templates/install-deps.yml
- template: templates/fabcar/azure-pipelines-java.yml

- job: commercialpaper_javascript
displayName: CommercialPaper (JavaScript)
- job: FabCar_JavaScript
displayName: FabCar (JavaScript)
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: commercialpaper-javascript.yml
- template: templates/install-deps.yml
- template: templates/fabcar/azure-pipelines-javascript.yml

- job: commercialpaper_java
displayName: CommercialPaper (Java)
- job: Fabcar_TypeScript
displayName: FabCar (TypeScript)
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: commercialpaper-java.yml
- template: templates/install-deps.yml
- template: templates/fabcar/azure-pipelines-typescript.yml

- job: commercialpaper_go
displayName: CommercialPaper (Go)
- job: TestNetwork
displayName: Test Network
pool:
vmImage: ubuntu-18.04
dependsOn: []
timeoutInMinutes: 60
steps:
- template: install-deps.yml
- template: install-fabric.yml
- template: commercialpaper-go.yml
- template: templates/install-deps.yml
- template: templates/test-network/azure-pipelines.yml
41 changes: 0 additions & 41 deletions ci/getDockerImages.sh

This file was deleted.

11 changes: 0 additions & 11 deletions ci/install-deps.yml

This file was deleted.

15 changes: 0 additions & 15 deletions ci/install-fabric.yml

This file was deleted.

15 changes: 15 additions & 0 deletions ci/scripts/pullFabricImages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash -e
set -euo pipefail

# FABRIC_VERSION is set in ci/azure-pipelines.yml
STABLE_TAG=amd64-${FABRIC_VERSION}-stable

for image in baseos peer orderer ca tools orderer ccenv javaenv nodeenv; do
docker pull -q hyperledger-fabric.jfrog.io/fabric-${image}:${STABLE_TAG}
docker tag hyperledger-fabric.jfrog.io/fabric-${image}:${STABLE_TAG} hyperledger/fabric-${image}
docker tag hyperledger-fabric.jfrog.io/fabric-${image}:${STABLE_TAG} hyperledger/fabric-${image}:${FABRIC_VERSION}
docker rmi -f hyperledger-fabric.jfrog.io/fabric-${image}:${STABLE_TAG}
done

docker pull -q hyperledger/fabric-couchdb
docker images | grep hyperledger
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@
steps:
- script: go test ./...
workingDirectory: commercial-paper/organization/magnetocorp/contract-go
displayName: Go unit test magnetocorp
displayName: Unit Test MagnetoCorp Chaincode
- script: go test ./...
workingDirectory: commercial-paper/organization/digibank/contract-go
displayName: Go unit test digibank
displayName: Unit Test DigiBank Chaincode

- script: |
go mod vendor
- script: go mod vendor
workingDirectory: commercial-paper/organization/magnetocorp/contract-go
- script: |
go mod vendor
workingDirectory: commercial-paper/organization/digibank/contract-go
displayName: Vendor MagnetoCorp Dependencies
- script: go mod vendor
workingDirectory: commercial-paper/organization/digibank/contract-go
displayName: Vendor DigiBank Dependencies

- script: |
echo $PATH
ls -l /usr/local/bin/peer
sudo tar xzvf /tmp/hyperledger-fabric-linux-amd64-latest.tar.gz -C ..
./network.sh down
./network.sh up createChannel -s couchdb -i 2.0.0
./network.sh up createChannel -s couchdb -i ${FABRIC_VERSION} # FABRIC_VERSION is set in ci/azure-pipelines.yml

# Copy the connection profiles so they are in the correct organizations.
cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/"
cp "./organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "../commercial-paper/organization/magnetocorp/gateway/"
workingDirectory: test-network
displayName: Start Fabric
env:
FABRIC_CFG_PATH: /usr/local/config
- script: |
source <(./magnetocorp.sh)
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
Expand All @@ -50,9 +44,7 @@ steps:

peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
workingDirectory: commercial-paper/organization/magnetocorp
displayName: Setup Commercial Paper contract
env:
FABRIC_CFG_PATH: /usr/local/config
displayName: Setup Commercial Paper Contract
- script: |
source <(./digibank.sh)
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
Expand Down Expand Up @@ -81,29 +73,25 @@ steps:
--tls --cafile $ORDERER_CA --waitForEvent

workingDirectory: commercial-paper/organization/digibank
displayName: Setup Commercial Paper contract
env:
FABRIC_CFG_PATH: /usr/local/config


displayName: Setup Commercial Paper Contract

- script: retry -- npm install
workingDirectory: commercial-paper/organization/magnetocorp/application
displayName: Install Magnetocorp application
displayName: Install Magnetocorp Application
- script: |
set -ex
node addToWallet.js
node issue.js
workingDirectory: commercial-paper/organization/magnetocorp/application
displayName: Magnetocorp issue paper
displayName: MagnetoCorp Issue Paper

- script: retry -- npm install
workingDirectory: commercial-paper/organization/digibank/application
displayName: Install Digibank application
displayName: Install DigiBank Application
- script: |
set -ex
node addToWallet.js
node buy.js
node redeem.js
workingDirectory: commercial-paper/organization/digibank/application
displayName: Digibank issue paper
displayName: Digibank Issue Paper
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,20 @@ steps:
- script: |
./gradlew build
workingDirectory: commercial-paper/organization/digibank/contract-java
displayName: Build Java Contract
displayName: Build DigiBank Java Contract
- script: |
./gradlew build
workingDirectory: commercial-paper/organization/magnetocorp/contract-java
displayName: Build Java Contract
displayName: Build MagnetoCorp Java Contract

- script: |
echo $PATH
ls -l /usr/local/bin/peer
sudo tar xzvf /tmp/hyperledger-fabric-linux-amd64-latest.tar.gz -C ..
./network.sh down
./network.sh up createChannel -s couchdb -i 2.0.0
./network.sh up createChannel -s couchdb -i ${FABRIC_VERSION} # FABRIC_VERSION is set in ci/azure-pipelines.yml

# Copy the connection profiles so they are in the correct organizations.
cp "./organizations/peerOrganizations/org1.example.com/connection-org1.yaml" "../commercial-paper/organization/digibank/gateway/"
cp "./organizations/peerOrganizations/org2.example.com/connection-org2.yaml" "../commercial-paper/organization/magnetocorp/gateway/"
workingDirectory: test-network
displayName: Start Fabric
env:
FABRIC_CFG_PATH: /usr/local/config
- script: |
source <(./magnetocorp.sh)
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
Expand All @@ -45,9 +39,7 @@ steps:

peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
workingDirectory: commercial-paper/organization/magnetocorp
displayName: Setup Commercial Paper contract
env:
FABRIC_CFG_PATH: /usr/local/config
displayName: Setup Commercial Paper Contract
- script: |
source <(./digibank.sh)
peer lifecycle chaincode package cp.tar.gz --lang java --path ./contract-java --label cp_0
Expand Down Expand Up @@ -76,28 +68,25 @@ steps:
--tls --cafile $ORDERER_CA --waitForEvent

workingDirectory: commercial-paper/organization/digibank
displayName: Setup Commercial Paper contract
env:
FABRIC_CFG_PATH: /usr/local/config

displayName: Setup Commercial Paper Contract

- script: retry -- npm install
workingDirectory: commercial-paper/organization/magnetocorp/application
displayName: Install Magnetocorp application
displayName: Install MagnetoCorp Application
- script: |
set -ex
node addToWallet.js
node issue.js
workingDirectory: commercial-paper/organization/magnetocorp/application
displayName: Magnetocorp issue paper
displayName: MagnetoCorp Issue Paper

- script: retry -- npm install
workingDirectory: commercial-paper/organization/digibank/application
displayName: Install Digibank application
displayName: Install DigiBank Application
- script: |
set -ex
node addToWallet.js
node buy.js
node redeem.js
workingDirectory: commercial-paper/organization/digibank/application
displayName: Digibank issue paper
displayName: DigiBank Issue Paper
Loading