Last active
February 21, 2019 11:22
-
-
Save javaguirre/f3270955476e8f833131afee243e5316 to your computer and use it in GitHub Desktop.
Deploy stage on IBM Blockchain for Hyperledger Fabric
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| deploy_staging: | |
| stage: deploy | |
| script: | |
| # Install chaincode in IBM Blockchain | |
| - > | |
| "curl -X POST https://$NETWORK_STAGING_KEY:[email protected]/api/v1/networks/$NETWORK_STAGING_ID/chaincode/install | |
| -H 'accept: application/json' | |
| -H 'Content-Type: multipart/form-data' | |
| -F 'files=@chaincode/chaincode_name/chaincode_name.go' | |
| -F 'chaincode_id=chaincode_name' | |
| -F \"chaincode_version=$CI_COMMIT_SHA\" | |
| -F 'chaincode_type=golang'" | |
| # Instantiate chaincode in the Channel $CHANNEL_STAGING_ID | |
| - > | |
| "curl -X POST https://$NETWORK_STAGING_KEY:[email protected]/api/v1/networks/$NETWORK_STAGING_ID/channels/$CHANNEL_STAGING_ID/chaincode/instantiate | |
| -H 'accept: application/json' | |
| -H 'Content-Type: application/json' | |
| --data '{ \"chaincode_id\": \"chaincode_name\", | |
| \"chaincode_version\": \"'\"$CI_COMMIT_SHA\"'\", | |
| \"chaincode_type\": \"golang\", | |
| \"chaincode_arguments\": [], | |
| \"endorsement_policy\": { \"identities\": [ | |
| { \"role\": { \"name\": \"member\", \"mspId\": \"org1\" } }, | |
| { \"role\": { \"name\": \"member\", \"mspId\": \"org2\" } } | |
| ], \"policy\": { \"1-of\": [ { \"signed-by\": 0 }, { \"signed-by\": 1 } ] } }}'" | |
| only: | |
| - master | |
| deploy_production: | |
| stage: deploy | |
| script: | |
| # Install chaincode in IBM Blockchain | |
| - > | |
| "curl -X POST https://$NETWORK_KEY:[email protected]/api/v1/networks/$NETWORK_ID/chaincode/install | |
| -H 'accept: application/json' | |
| -H 'Content-Type: multipart/form-data' | |
| -F 'files=@chaincode/chaincode_name/chaincode_name.go' | |
| -F 'chaincode_id=chaincode_name' | |
| -F \"chaincode_version=$CI_COMMIT_TAG\" | |
| -F 'chaincode_type=golang'" | |
| # Instantiate chaincode in the Channel $CHANNEL_PRODUCTION_ID | |
| - > | |
| "curl -X POST https://$NETWORK_KEY:[email protected]/api/v1/networks/$NETWORK_ID/channels/$CHANNEL_PRODUCTION_ID/chaincode/instantiate | |
| -H 'accept: application/json' | |
| -H 'Content-Type: application/json' | |
| --data '{ \"chaincode_id\": \"chaincode_name\", | |
| \"chaincode_version\": \"'\"$CI_COMMIT_TAG\"'\", | |
| \"chaincode_type\": \"golang\", | |
| \"chaincode_arguments\": [], | |
| \"endorsement_policy\": { \"identities\": [ | |
| { \"role\": { \"name\": \"member\", \"mspId\": \"org1\" } }, | |
| { \"role\": { \"name\": \"member\", \"mspId\": \"org2\" } } | |
| ], | |
| \"policy\": { \"1-of\": [ { \"signed-by\": 0 }, { \"signed-by\": 1 } ] } }}'" | |
| only: | |
| - tags |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment