Skip to content

Commit

Permalink
Refactored Corda Simple Application Makefile to better handle errors
Browse files Browse the repository at this point in the history
Signed-off-by: VRamakrishna <[email protected]>
  • Loading branch information
VRamakrishna authored and sandeepnRES committed May 17, 2024
1 parent 53c9ac9 commit a79dac0
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions samples/corda/corda-simple-application/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,31 +52,43 @@ test: github.properties

.PHONY: initialise-vault
initialise-vault:
(docker logs corda_partya_1 && REMOTE_FLOW="localhost:30006#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all) || true
if [ $(shell docker ps | grep corda_partya_1 | wc -l) -eq 1 ]; then \
REMOTE_FLOW="localhost:30006#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all; \
fi
if [ $(shell docker ps | grep corda_network2_partya_1 | wc -l) -eq 1 ]; then \
(docker logs corda_network2_partya_1 && CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 REMOTE_FLOW="localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all) || true; \
CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 REMOTE_FLOW="localhost:10006#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all; \
fi

.PHONY: initialise-vault-docker
initialise-vault-docker:
(docker logs corda_partya_1 && MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" REMOTE_FLOW="corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" LOCAL_FLOW="corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all) || true
if [ $(shell docker ps | grep corda_partya_1 | wc -l) -eq 1 ]; then \
MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" REMOTE_FLOW="corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" LOCAL_FLOW="corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all; \
fi
if [ $(shell docker ps | grep corda_network2_partya_1 | wc -l) -eq 1 ]; then \
(docker logs corda_network2_partya_1 && CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" REMOTE_FLOW="corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" LOCAL_FLOW="corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all) || true; \
CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" REMOTE_FLOW="corda_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" LOCAL_FLOW="corda_network2_partya_1:10003#com.cordaSimpleApplication.flow.GetStateByKey:*" ./clients/build/install/clients/bin/clients configure all; \
fi

.PHONY: initialise-vault-asset-transfer
initialise-vault-asset-transfer:
(docker logs corda_partya_1 && ./clients/build/install/clients/bin/clients configure network) || true
(docker logs corda_partya_1 && ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB") || true
(docker logs corda_network2_partya_1 && CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients configure network) || true
(docker logs corda_network2_partya_1 && CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB") || true
if [ $(shell docker ps | grep corda_partya_1 | wc -l) -eq 1 ]; then \
./clients/build/install/clients/bin/clients configure network; \
./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB"; \
fi
if [ $(shell docker ps | grep corda_network2_partya_1 | wc -l) -eq 1 ]; then \
CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients configure network; \
CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB"; \
fi

.PHONY: initialise-vault-asset-transfer-docker
initialise-vault-asset-transfer-docker:
(docker logs corda_partya_1 && MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" ./clients/build/install/clients/bin/clients configure network) || true
(docker logs corda_partya_1 && ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB") || true
(docker logs corda_network2_partya_1 && MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients configure network) || true
(docker logs corda_network2_partya_1 && CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB") || true
if [ $(shell docker ps | grep corda_partya_1 | wc -l) -eq 1 ]; then \
MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" ./clients/build/install/clients/bin/clients configure network; \
./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB"; \
fi
if [ $(shell docker ps | grep corda_network2_partya_1 | wc -l) -eq 1 ]; then \
MEMBER_CREDENTIAL_FOLDER="clients/src/main/resources/config/credentials_docker" CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients configure network; \
CORDA_PORT=30006 NETWORK_NAME=Corda_Network2 ./clients/build/install/clients/bin/clients network-id create-state -m "O=PartyA, L=London, C=GB;O=PartyB, L=London, C=GB"; \
fi

.PHONY: get-access-control-policies
get-access-control-policies:
Expand Down

0 comments on commit a79dac0

Please sign in to comment.