init-bucket.sh 905 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. SCRIPT_PATH="$(dirname "${BASH_SOURCE[0]}")"
  3. cd $SCRIPT_PATH
  4. export AUTO_CONFIRM=true
  5. export CONFIG_PATH="../config.yml"
  6. CLI=../bin/run
  7. GROUP=distributionWorkingGroup yarn workspace api-scripts initialize-lead
  8. ${CLI} leader:set-buckets-per-bag-limit -l 10
  9. FAMILY_ID=`${CLI} leader:create-bucket-family ${CONFIG}`
  10. BUCKET_INDEX=`${CLI} leader:create-bucket -f ${FAMILY_ID} -a yes`
  11. BUCKET_ID="${FAMILY_ID}:${BUCKET_INDEX}"
  12. ${CLI} leader:update-bag -b static:council -f ${FAMILY_ID} -a ${BUCKET_INDEX}
  13. ${CLI} leader:update-bucket-mode -B ${BUCKET_ID} --mode on
  14. ${CLI} leader:invite-bucket-operator -B ${BUCKET_ID} -w 0
  15. ${CLI} operator:accept-invitation -B ${BUCKET_ID} -w 0
  16. ${CLI} operator:set-metadata -B ${BUCKET_ID} -w 0 -e http://localhost:3334
  17. ${CLI} leader:update-dynamic-bag-policy -t Channel -p ${FAMILY_ID}:1
  18. ${CLI} leader:update-dynamic-bag-policy -t Member -p ${FAMILY_ID}:1