Skip to content

Commit

Permalink
Pull Fabric Images in CI (#204)
Browse files Browse the repository at this point in the history
Signed-off-by: Brett Logan <[email protected]>
  • Loading branch information
Brett Logan authored Apr 1, 2020
1 parent 361a7ad commit 1abaa4c
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 31 deletions.
6 changes: 4 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ stages:
- script: npm install
displayName: npm install
- script: npm run installAndGenerateCerts
displayName: 'Generate credentials'
displayName: Generate credentials
- script: npm run pullFabricImages
displayName: Pull Fabric Images
- script: npm test
displayName: 'Run tests'
displayName: Run tests

- stage: Publish
displayName: Publish Packages and Docs
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"scripts": {
"installAndGenerateCerts": "node ./scripts/npm_scripts/generateCerts.js",
"pullFabricImages": "./scripts/utility/fabric_images.sh",
"test": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegration cucumberScenario",
"testNoHSM": "run-s checkLicense cleanUp dockerClean compile lint docs unitTest:all dockerReady tapeIntegrationNoHSM cucumberScenario",
"checkLicense": "./scripts/npm_scripts/checkLicense.sh",
Expand Down
29 changes: 10 additions & 19 deletions scripts/utility/fabric_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,21 @@ echo "======== PULL DOCKER IMAGES ========"
echo "Fetching images from Artifactory"
ARTIFACTORY_URL=hyperledger-fabric.jfrog.io

ARCH=$1
: ${STABLE_VERSION:=$2}
ARCH=amd64
STABLE_VERSION=2.1-stable
STABLE_TAG="${ARCH}-${STABLE_VERSION}"
VERSION_TAG="${STABLE_VERSION%%-*}"
echo "---------> STABLE_VERSION: ${STABLE_VERSION}"

dockerTag() {
for IMAGE in ca peer orderer ccenv baseos nodeenv javaenv tools; do
echo
echo "Pulling Image: ${ARTIFACTORY_URL}/fabric-${IMAGE}:${STABLE_TAG}"
echo
ARTIFACTORY_IMAGE="${ARTIFACTORY_URL}/fabric-${IMAGE}:${STABLE_TAG}"
docker pull "${ARTIFACTORY_IMAGE}"
if [ $? != 0 ]; then
echo "FAILED: Docker Pull Failed on ${IMAGE}"
exit 1
fi
IMAGE_NAME="fabric-${IMAGE}"
docker tag "${ARTIFACTORY_IMAGE}" "hyperledger/${IMAGE_NAME}"
docker tag "${ARTIFACTORY_IMAGE}" "hyperledger/${IMAGE_NAME}:${VERSION_TAG}"
echo "${IMAGE_NAME}:${VERSION_TAG}"
echo "Deleting Artifactory docker images: $IMAGE"
docker rmi -f "${ARTIFACTORY_IMAGE}"
done
for IMAGE in ca peer orderer ccenv baseos nodeenv javaenv tools; do
ARTIFACTORY_IMAGE="${ARTIFACTORY_URL}/fabric-${IMAGE}:${STABLE_TAG}"
IMAGE_NAME="fabric-${IMAGE}"
docker pull "${ARTIFACTORY_IMAGE}"
docker tag "${ARTIFACTORY_IMAGE}" "hyperledger/${IMAGE_NAME}"
docker tag "${ARTIFACTORY_IMAGE}" "hyperledger/${IMAGE_NAME}:${VERSION_TAG}"
docker rmi -f "${ARTIFACTORY_IMAGE}"
done
}

dockerTag
Expand Down
2 changes: 1 addition & 1 deletion test/ts-scenario/features/base_api.feature
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Feature: Use base API to perform core operations

Background:
Given I place a scenario start message BASE API FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named eventschannel on the deployed network
And I use the cli to update the channel with name eventschannel with config file eventschannel-anchor.tx on the deployed network
And I use the cli to lifecycle deploy a node smart contract named fabcar at version 1.0.0 as fabcar for all organizations on channel eventschannel with default endorsement policy and init-required true
Expand Down
4 changes: 2 additions & 2 deletions test/ts-scenario/features/chaincode_lifecycle.feature.norun
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Use the v2.0 chaincode lifecycle process to perform lifecycle operation

Background:
Given I place a scenario start message LIFECYCLE SDK FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named lifecyclechannel on the deployed network

Scenario: Using the SDK I can run node smart contracts through their lifecycle on a two org network
Expand Down Expand Up @@ -64,4 +64,4 @@ Feature: Use the v2.0 chaincode lifecycle process to perform lifecycle operation
# When I approve the installed contract named legacyGoPrivateData as organizations [Org1,Org2] on channel lifecyclechannel with endorsement policy 1ofAny with collections config file legacyGoPrivateData/collections_config.json
# Then I can query commit readiness for contract named legacyGoPrivateData as organizations [Org1,Org2] on channel lifecyclechannel with expected approvals status of {"Org1MSP":true,"Org2MSP":true}
# When I call commit on contract named legacyGoPrivateData as organization Org1 on channel lifecyclechannel
# Then I can query for defined contract named legacyGoPrivateData as organizations [Org1,Org2] on channel lifecyclechannel with expected result including {"init_required":true,"version":"v1", "sequence":"1", "validation_plugin": "vscc", "endorsement_plugin": "escc"}
# Then I can query for defined contract named legacyGoPrivateData as organizations [Org1,Org2] on channel lifecyclechannel with expected result including {"init_required":true,"version":"v1", "sequence":"1", "validation_plugin": "vscc", "endorsement_plugin": "escc"}
2 changes: 1 addition & 1 deletion test/ts-scenario/features/channel_operations.feature.norun
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Feature: Use the channel query methods

Background:
Given I place a scenario start message CHANNEL FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named channelopschannel on the deployed network
And I use the cli to create and join the channel named channelopschannelvtwo on the deployed network
And I use the cli to update the channel with name channelopschannelvtwo with config file channelopschannelvtwo-anchor.tx on the deployed network
Expand Down
2 changes: 1 addition & 1 deletion test/ts-scenario/features/deprecated_sdk.feature.norun
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Use the Node SDK to install/instantiate/Upgrade chaincode with the depr

Background:
Given I place a scenario start message DEPRECATED SDK FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named deprecatedchannel on the deployed network

Scenario: Using the deprecated API I can install and instantate a smart contract that may subsequently be used through a Gateway
Expand Down
4 changes: 2 additions & 2 deletions test/ts-scenario/features/discovery.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Configure Fabric using CLI and submit/evaluate using a network Gateway

Background:
Given I place a scenario start message DISCOVERY FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named discoverychannel on the deployed network
And I use the cli to update the channel with name discoverychannel with config file discoverychannel-anchor.tx on the deployed network
#And I use the cli to deploy a node smart contract named fabcar at version 1.0.0 for all organizations on channel discoverychannel with endorsement policy 1of and arguments ["initLedger"]
Expand Down Expand Up @@ -62,4 +62,4 @@ Feature: Configure Fabric using CLI and submit/evaluate using a network Gateway
When I modify myDiscoveryGateway to submit a transaction with transient data using args [getTransient,value1,value2] for contract fabcar instantiated on channel discoverychannel
Then The gateway named myDiscoveryGateway has a submit type response matching {"key0":"value1","key1":"value2"}
When I modify myDiscoveryGateway to evaluate a transaction with transient data using args [getTransient,valueA,valueB] for contract fabcar instantiated on channel discoverychannel
Then The gateway named myDiscoveryGateway has a evaluate type response matching {"key0":"valueA","key1":"valueB"}
Then The gateway named myDiscoveryGateway has a evaluate type response matching {"key0":"valueA","key1":"valueB"}
2 changes: 1 addition & 1 deletion test/ts-scenario/features/events.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Node SDK Events

Background:
Given I place a scenario start message EVENTS FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named eventschannel on the deployed network
And I use the cli to update the channel with name eventschannel with config file eventschannel-anchor.tx on the deployed network
And I use the cli to lifecycle deploy a node smart contract named events at version 1.0.0 as events for all organizations on channel eventschannel with default endorsement policy and init-required false
Expand Down
2 changes: 1 addition & 1 deletion test/ts-scenario/features/gateway.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Configure Fabric using CLI and submit/evaluate using a network Gateway

Background:
Given I place a scenario start message GATEWAY FEATURE
Given I deploy a tls Fabric network at 2.0 version
Given I deploy a tls Fabric network at 2.1 version
And I use the cli to create and join the channel named gatewaychannel on the deployed network
And I use the cli to update the channel with name gatewaychannel with config file gatewaychannel-anchor.tx on the deployed network
And I use the cli to lifecycle deploy a node smart contract named fabcar at version 1.0.0 as fabcar for all organizations on channel gatewaychannel with default endorsement policy and init-required false
Expand Down
2 changes: 1 addition & 1 deletion test/ts-scenario/features/nontls-gateway.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Feature: Configure Fabric using CLI and submit/evaluate using a network Gateway

Background:
Given I place a scenario start message GATEWAY NON TLS FEATURE
Given I deploy a non-tls Fabric network at 2.0 version
Given I deploy a non-tls Fabric network at 2.1 version
And I use the cli to create and join the channel named gatewaychannel on the deployed network
And I use the cli to update the channel with name gatewaychannel with config file gatewaychannel-anchor.tx on the deployed network
And I use the cli to lifecycle deploy a node smart contract named fabcar at version 1.0.0 as fabcar for all organizations on channel gatewaychannel with default endorsement policy and init-required false
Expand Down

0 comments on commit 1abaa4c

Please sign in to comment.