diff --git a/apps/contract-migration/config.sh b/apps/contract-migration/config.sh index 819b131c..1a39b576 100644 --- a/apps/contract-migration/config.sh +++ b/apps/contract-migration/config.sh @@ -5,7 +5,13 @@ set -a if [ -z $DEV_DATA_DIR ]; then export DEV_DATA_DIR=`mktemp -d` else - mkdir -p $DEV_DATA_DIR + mkdir -vp $DEV_DATA_DIR +fi + +if [ -z $STATE_DIR ]; then + export STATE_DIR=/run/cic_init + mkdir -vp $STATE_DIR + echo 0 > $STATE_DIR/init fi if [ -z $DEV_CONFIG_RESET ]; then diff --git a/apps/contract-migration/reset.sh b/apps/contract-migration/reset.sh index f4d45f7f..c60ea96a 100755 --- a/apps/contract-migration/reset.sh +++ b/apps/contract-migration/reset.sh @@ -117,6 +117,8 @@ export CIC_DEFAULT_TOKEN_SYMBOL=$CIC_DEFAULT_TOKEN_SYMBOL export TOKEN_NAME=$TOKEN_NAME " >> "${DEV_DATA_DIR}"/env_reset +echo -n $CIC_REGISTRY_ADDRESS > $STATE_DIR/registry + set +a set +e diff --git a/apps/contract-migration/run_job.sh b/apps/contract-migration/run_job.sh index 0df34361..c7101872 100644 --- a/apps/contract-migration/run_job.sh +++ b/apps/contract-migration/run_job.sh @@ -16,6 +16,7 @@ then >&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 1 - contract deployment" exit 1; fi + echo -n 1 > $STATE_DIR/init >&2 echo -e "\033[;32mSUCCEEDED\033[;39m RUN_MASK 1 - contract deployment" fi @@ -27,5 +28,6 @@ then >&2 echo -e "\033[;31mFAILED\033[;39m RUN_MASK 2 - custodial service initialization" exit 1; fi + echo -n 2 > $STATE_DIR/init >&2 echo -e "\033[;32mSUCCEEDED\033[;39m RUN_MASK 2 - custodial service initialization" fi