mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-17 15:35:09 +00:00
This change organizes the `ci` directory into common-sense subfolders and standardizes pipelines naming schemes. Also removes the dead Jenkins code in the `./scripts` directory Signed-off-by: Brett Logan <brett.t.logan@ibm.com>
82 lines
4.2 KiB
YAML
82 lines
4.2 KiB
YAML
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
steps:
|
|
- script: |
|
|
./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
|
|
- script: |
|
|
source <(./magnetocorp.sh)
|
|
peer lifecycle chaincode package cp.tar.gz --lang node --path ./contract --label cp_0
|
|
peer lifecycle chaincode install cp.tar.gz
|
|
|
|
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
|
echo $PACKAGE_ID
|
|
|
|
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
|
--channelID mychannel \
|
|
--name papercontract \
|
|
-v 0 \
|
|
--package-id $PACKAGE_ID \
|
|
--sequence 1 \
|
|
--tls \
|
|
--cafile $ORDERER_CA
|
|
|
|
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
|
workingDirectory: commercial-paper/organization/magnetocorp
|
|
displayName: Setup Commercial Paper Contract
|
|
- script: |
|
|
source <(./digibank.sh)
|
|
peer lifecycle chaincode package cp.tar.gz --lang node --path ./contract --label cp_0
|
|
peer lifecycle chaincode install cp.tar.gz
|
|
|
|
export PACKAGE_ID=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[0].package_id')
|
|
echo $PACKAGE_ID
|
|
|
|
peer lifecycle chaincode approveformyorg --orderer localhost:7050 --ordererTLSHostnameOverride orderer.example.com \
|
|
--channelID mychannel \
|
|
--name papercontract \
|
|
-v 0 \
|
|
--package-id $PACKAGE_ID \
|
|
--sequence 1 \
|
|
--tls \
|
|
--cafile $ORDERER_CA
|
|
|
|
peer lifecycle chaincode checkcommitreadiness --channelID mychannel --name papercontract -v 0 --sequence 1
|
|
|
|
peer lifecycle chaincode commit -o localhost:7050 \
|
|
--peerAddresses localhost:7051 --tlsRootCertFiles ${PEER0_ORG1_CA} \
|
|
--peerAddresses localhost:9051 --tlsRootCertFiles ${PEER0_ORG2_CA} \
|
|
--ordererTLSHostnameOverride orderer.example.com \
|
|
--channelID mychannel --name papercontract -v 0 \
|
|
--sequence 1 \
|
|
--tls --cafile $ORDERER_CA --waitForEvent
|
|
|
|
workingDirectory: commercial-paper/organization/digibank
|
|
displayName: Setup Commercial Paper Contract
|
|
- script: retry -- npm install
|
|
workingDirectory: commercial-paper/organization/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
|
|
|
|
- script: retry -- npm install
|
|
workingDirectory: commercial-paper/organization/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
|