Skip to content

Commit

Permalink
refactor 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Bell committed Nov 18, 2024
1 parent 1920a6b commit 5dc8bac
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
18 changes: 10 additions & 8 deletions packages/cacti-copm-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,20 @@ PATH := $(PATH):$(WORKSPACE)/protoc/bin

# SETUP - run once

fabric-setup:
common-setup:
cd $(WORKSPACE)/weaver/core/relay && make build-images-local


fabric-setup: common-setup
cd $(WORKSPACE)/weaver/common/protos-js && make build
rm -Rf $(WORKSPACE)/weaver/sdks/fabric/interoperation-node-sdk/build
cd $(WORKSPACE)/weaver/sdks/fabric/interoperation-node-sdk && make build-local
cd $(WORKSPACE)/weaver/core/identity-management/iin-agent && make build-local build-image-local
cd $(WORKSPACE)/weaver/samples/fabric/fabric-cli && make build-local
cd $(WORKSPACE)/weaver/core/drivers/fabric-driver && make build-image-local

corda-setup:
cd $(WORKSPACE)/weaver/common/protos-java-kt && make build
cd $(WORKSPACE)/weaver/core/network/corda-interop-app && make build-local
cd $(WORKSPACE)/weaver/sdks/corda && make build
cd $(WORKSPACE)/weaver/samples/corda/corda-simple-application && make build-local
corda-setup: common-setup
cd $(WORKSPACE)/weaver/core/drivers/corda-driver && make build-image-local

stop-network:
cd $(WORKSPACE)/weaver/tests/network-setups/fabric/dev && make stop-network1 stop-network2 PROFILE=2-nodes
Expand All @@ -191,7 +193,7 @@ docker stop `docker container ls -a -q -f ancestor=$(1) | xargs` || true
docker rm `docker container ls -a -q -f ancestor=$(1) | xargs` || true
endef

clean-network:
clean-network: stop-network
$(foreach image,$(DOCKER_IMAGES),$(call stop_docker,$(image)))
cd $(WORKSPACE)/weaver/tests/network-setups/fabric/dev && make clean || true
docker volume prune -f
Expand All @@ -206,4 +208,4 @@ clean-network:
fi
docker volume rm `docker volume ls | grep -v NAME | sed -e 's/local //g' | grep -v vscode | xargs` || true
cd $(WORKSPACE)/weaver/tests/network-setups/corda && make clean || true
rm $(COPM_TARGET_DIR)/*/*network-up.txt || true
rm $(COPM_TARGET_DIR)/*txt || true
8 changes: 6 additions & 2 deletions packages/cacti-plugin-copm-corda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ WORKSPACE ?= $(shell realpath `pwd`/../../)

# file targets are used as placeholders to ensure that steps are only run once
COPM_TARGET_DIR=$(WORKSPACE)/packages/cacti-copm-test/target
CORDA_SETUP_TARGET=$(COPM_TARGET_DIR)/corda-setup.txt
SETUP_TARGET=$(COPM_TARGET_DIR)/corda-setup.txt
LOCK_NETWORK=$(COPM_TARGET_DIR)/corda-lock-network-up.txt
PLEDGE_NETWORK=$(COPM_TARGET_DIR)/corda-pledge-network-up.txt

Expand Down Expand Up @@ -45,7 +45,9 @@ docker-image:

localdeps: $(LOCALDEPS)

setup: localdeps docker-image
$(SETUP_TARGET): localdeps docker-image
cd $(WORKSPACE)/packages/cacti-copm-test && make corda-setup
touch $(SETUP_TARGET)

$(PLEDGE_NETWORK): setup
cd $(WORKSPACE)/packages/cacti-copm-test && \
Expand All @@ -61,6 +63,8 @@ pledge-network: $(PLEDGE_NETWORK)

lock-network: $(LOCK_NETWORK)

setup: $(SETUP_TARGET)

clean-network:
cd $(WORKSPACE)/packages/cacti-copm-test && make clean-network

0 comments on commit 5dc8bac

Please sign in to comment.