Set cic-eth seed script to run sequentially after contract migration

This commit is contained in:
nolash 2021-02-11 17:20:31 +01:00
parent 6d6285a897
commit 33c00ed93b
Signed by untrusted user who does not match committer: lash
GPG Key ID: 21D2E7BB88C2A746
3 changed files with 15 additions and 3 deletions

View File

@ -19,7 +19,7 @@ echo \n
# pushd /usr/src
init_level_file=${CIC_DATA_DIR}/.init
echo -n 0 > $init_level_file
echo -n 1 > $init_level_file
# Abort on any error (including if wait-for-it fails).
set -e
@ -68,6 +68,6 @@ cat $CIC_DATA_DIR/envlist | bash from_env.sh > $CIC_DATA_DIR/.env_all
set +a
set +e
echo -n 1 > $init_level_file
echo -n 2 > $init_level_file
exec "$@"

View File

@ -1,6 +1,12 @@
#!/bin/bash
# defaults
initlevel=`cat ${CIC_DATA_DIR}/.init`
echo $inilevel
if [ $initlevel -lt 2 ]; then
>&2 echo "initlevel too low $initlevel"
exit 1
fi
source ${CIC_DATA_DIR}/.env
source ${CIC_DATA_DIR}/.env_all
DEV_PIP_EXTRA_INDEX_URL=${DEV_PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433}
@ -136,7 +142,7 @@ token_description_two=0x54686973206973207468652053617261667520746f6b656e00000000
>&2 echo "add keystore account $keystore_file to accounts index writers"
>&2 eth-accounts-index-add -y $keystore_file -i $CIC_CHAIN_SPEC -p $ETH_PROVIDER -r $CIC_ACCOUNTS_INDEX_ADDRESS --writer $DEV_ETH_ACCOUNT_ACCOUNTS_INDEX_WRITER -w $debug
echo -n 2 > $init_level_file
echo -n 0 > $init_level_file
set +a
set +e

View File

@ -117,8 +117,14 @@ services:
CELERY_RESULT_URL: ${CELERY_RESULT_URL:-redis://redis:6379}
DEV_PIP_EXTRA_INDEX_URL: ${DEV_PIP_EXTRA_INDEX_URL:-https://pip.grassrootseconomics.net:8433}
command: ["./seed_cic_eth.sh"]
deploy:
restart_policy:
condition: on-failure
depends_on:
- eth
- postgres
- redis
- cic-eth-tasker
volumes:
- contract-config:/tmp/cic/config