Skip to content

Commit

Permalink
[FAB-17498] Beta Images removal, test test-network (#121)
Browse files Browse the repository at this point in the history
Change 2.0.0-beta to 2.0.0 when CommercialPaper uses the test network
Add test network to the azure pipelines
Correct test network envvar script

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
  • Loading branch information
mbwhite committed Feb 12, 2020
1 parent 403019e commit 965ed1f
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 11 deletions.
12 changes: 12 additions & 0 deletions ci/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -75,6 +86,7 @@ jobs:
- template: install-deps.yml
- template: install-fabric.yml
- template: commercialpaper-java.yml

- job: commercialpaper_go
displayName: CommercialPaper (Go)
pool:
Expand Down
2 changes: 1 addition & 1 deletion ci/commercialpaper-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion ci/commercialpaper-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
2 changes: 1 addition & 1 deletion ci/commercialpaper-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down
15 changes: 15 additions & 0 deletions ci/testnetwork.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion commercial-paper/organization/digibank/digibank.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion commercial-paper/organization/magnetocorp/magnetocorp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
15 changes: 9 additions & 6 deletions test-network/scripts/envVar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 965ed1f

Please sign in to comment.