From 9be7df6bcfb0fb29024f3c5179e0fa7db5d34a55 Mon Sep 17 00:00:00 2001 From: vvzvlad Date: Sat, 21 Sep 2024 23:51:36 +0300 Subject: [PATCH] add sh files --- playbook.yml | 11 +++-------- rebuild.sh | 8 ++++++++ update_contracts.sh | 7 +++++++ 3 files changed, 18 insertions(+), 8 deletions(-) create mode 100644 rebuild.sh create mode 100644 update_contracts.sh diff --git a/playbook.yml b/playbook.yml index b338496..c57823c 100644 --- a/playbook.yml +++ b/playbook.yml @@ -19,11 +19,9 @@ path: "~/.bash_history" create: true block: | + cd ~/ritual; bash rebuild.sh + nano ~/ritual/projects/hello-world/container/config.json docker logs infernet-node -f - cd ~/ritual; project=hello-world make deploy-container - cd ~/ritual; project=hello-world make deploy-contracts - cd ~/ritual; contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json); checksum_address=$(python3 toChecksumAddress.py $contract_address); sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol - cd ~/ritual; project=hello-world make call-contract marker: "" mode: '0644' @@ -195,10 +193,7 @@ failed_when: '"ONCHAIN EXECUTION COMPLETE & SUCCESSFUL" not in contract_deploy_output.stdout' - name: Update CallContract.s.sol with contract address - ansible.builtin.shell: | - contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json) - checksum_address=$(python3 toChecksumAddress.py $contract_address) - sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol + ansible.builtin.shell: bash update_contracts.sh args: chdir: "{{ ansible_env.HOME }}/ritual" diff --git a/rebuild.sh b/rebuild.sh new file mode 100644 index 0000000..dc6d461 --- /dev/null +++ b/rebuild.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -e +cd ~/ritual +project=hello-world make deploy-container +project=hello-world make deploy-contracts +bash update_contracts.sh +project=hello-world make call-contract \ No newline at end of file diff --git a/update_contracts.sh b/update_contracts.sh new file mode 100644 index 0000000..949739e --- /dev/null +++ b/update_contracts.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -e +cd ~/ritual +contract_address=$(jq -r '.transactions[0].contractAddress' projects/hello-world/contracts/broadcast/Deploy.s.sol/8453/run-latest.json) +checksum_address=$(python3 toChecksumAddress.py $contract_address) +sed -i "s/SaysGM(.*/SaysGM($checksum_address);/" projects/hello-world/contracts/script/CallContract.s.sol \ No newline at end of file