diff --git a/ci/azure-pipelines.yml b/ci/azure-pipelines.yml index 2f737b6078..c9278068c9 100644 --- a/ci/azure-pipelines.yml +++ b/ci/azure-pipelines.yml @@ -21,6 +21,17 @@ jobs: - template: install-fabric.yml - template: fabcar-go.yml + - job: test_network + displayName: Start the test network + pool: + vmImage: ubuntu-18.04 + dependsOn: [] + timeoutInMinutes: 60 + steps: + - template: install-deps.yml + - template: install-fabric.yml + - template: testnetwork.yml + - job: fabcar_java displayName: FabCar (Java) pool: @@ -75,6 +86,7 @@ jobs: - template: install-deps.yml - template: install-fabric.yml - template: commercialpaper-java.yml + - job: commercialpaper_go displayName: CommercialPaper (Go) pool: diff --git a/ci/commercialpaper-go.yml b/ci/commercialpaper-go.yml index 32a58e4019..0396051ddc 100644 --- a/ci/commercialpaper-go.yml +++ b/ci/commercialpaper-go.yml @@ -22,7 +22,7 @@ steps: 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-beta + ./network.sh up createChannel -s couchdb -i 2.0.0 # 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/" diff --git a/ci/commercialpaper-java.yml b/ci/commercialpaper-java.yml index bd798d9886..8143aeae67 100644 --- a/ci/commercialpaper-java.yml +++ b/ci/commercialpaper-java.yml @@ -17,7 +17,7 @@ steps: 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-beta + ./network.sh up createChannel -s couchdb -i 2.0.0 # 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/" diff --git a/ci/commercialpaper-javascript.yml b/ci/commercialpaper-javascript.yml index 0765896d31..790beaef3d 100644 --- a/ci/commercialpaper-javascript.yml +++ b/ci/commercialpaper-javascript.yml @@ -8,7 +8,7 @@ steps: 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-beta + ./network.sh up createChannel -s couchdb -i 2.0.0 # 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/" diff --git a/ci/testnetwork.yml b/ci/testnetwork.yml new file mode 100644 index 0000000000..9cf27392ff --- /dev/null +++ b/ci/testnetwork.yml @@ -0,0 +1,15 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# + +steps: + - script: | + 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 deployCC -l javascript + + workingDirectory: test-network + displayName: Start up test network + env: + FABRIC_CFG_PATH: /usr/local/config diff --git a/commercial-paper/organization/digibank/digibank.sh b/commercial-paper/organization/digibank/digibank.sh index bb5e26c3e3..3aad75d29d 100755 --- a/commercial-paper/organization/digibank/digibank.sh +++ b/commercial-paper/organization/digibank/digibank.sh @@ -21,7 +21,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "${DIR}/../../../test-network" env | sort > /tmp/env.orig -ORG="1" +OVERRIDE_ORG="1" . ./scripts/envVar.sh parsePeerConnectionParameters 1 2 diff --git a/commercial-paper/organization/magnetocorp/magnetocorp.sh b/commercial-paper/organization/magnetocorp/magnetocorp.sh index 53651684f7..af456384e2 100755 --- a/commercial-paper/organization/magnetocorp/magnetocorp.sh +++ b/commercial-paper/organization/magnetocorp/magnetocorp.sh @@ -21,7 +21,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd "${DIR}/../../../test-network" env | sort > /tmp/env.orig -ORG="2" +OVERRIDE_ORG="2" . ./scripts/envVar.sh diff --git a/test-network/scripts/envVar.sh b/test-network/scripts/envVar.sh index 076ed9e17f..104e723ce8 100755 --- a/test-network/scripts/envVar.sh +++ b/test-network/scripts/envVar.sh @@ -21,22 +21,25 @@ setOrdererGlobals() { # Set environment variables for the peer org setGlobals() { - if [ -z "$ORG" ]; then - ORG=$1 + local USING_ORG="" + if [ -z "$OVERRIDE_ORG" ]; then + USING_ORG=$1 + else + USING_ORG="${OVERRIDE_ORG}" fi - - if [ $ORG -eq 1 ]; then + echo "Using organization ${USING_ORG}" + if [ $USING_ORG -eq 1 ]; then export CORE_PEER_LOCALMSPID="Org1MSP" export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG1_CA export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/Admin@org1.example.com/msp export CORE_PEER_ADDRESS=localhost:7051 - elif [ $ORG -eq 2 ]; then + elif [ $USING_ORG -eq 2 ]; then export CORE_PEER_LOCALMSPID="Org2MSP" export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG2_CA export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org2.example.com/users/Admin@org2.example.com/msp export CORE_PEER_ADDRESS=localhost:9051 - elif [ $ORG -eq 3 ]; then + elif [ $USING_ORG -eq 3 ]; then export CORE_PEER_LOCALMSPID="Org3MSP" export CORE_PEER_TLS_ROOTCERT_FILE=$PEER0_ORG3_CA export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org3.example.com/users/Admin@org3.example.com/msp