1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

copy contracts from Docker

This commit is contained in:
Matthias Kretschmann 2019-07-22 12:32:22 +02:00
parent c2e2606133
commit 036305c315
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -5,17 +5,25 @@
RETRY_COUNT=0 RETRY_COUNT=0
COMMAND_STATUS=1 COMMAND_STATUS=1
printf '\n\e[33mWaiting for contracts to be generated...\e[0m\n'
mkdir -p artifacts mkdir -p artifacts
until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do until [ $COMMAND_STATUS -eq 0 ] || [ $RETRY_COUNT -eq 120 ]; do
keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}') keeper_contracts_docker_id=$(docker container ls | grep keeper-contracts | awk '{print $1}')
docker cp ${keeper_contracts_docker_id}:/keeper-contracts/artifacts/ready ./artifacts/ docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/ready ./artifacts/ > /dev/null 2>&1
COMMAND_STATUS=$? COMMAND_STATUS=$?
sleep 5 sleep 5
let RETRY_COUNT=RETRY_COUNT+1 (( RETRY_COUNT=RETRY_COUNT+1 ))
done done
printf '\e[32mFound new contract artifacts.\e[0m\n'
rm -rf ./artifacts/
if [ $COMMAND_STATUS -ne 0 ]; then if [ $COMMAND_STATUS -ne 0 ]; then
echo "Waited for more than two minutes, but keeper contracts have not been migrated yet. Did you run an Ethereum RPC client and the migration script?" echo "Waited for more than two minutes, but keeper contracts have not been migrated yet. Did you run an Ethereum RPC client and the migration script?"
exit 1 exit 1
fi fi
docker cp "${keeper_contracts_docker_id}":/keeper-contracts/artifacts/. ./client/node_modules/@oceanprotocol/keeper-contracts/artifacts/