check-deploy-configs.sh 711 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/env bash

# This script is used to check for valid deploy configs.
# It should check all configs and return a non-zero exit code if any of them are invalid.
# getting-started.json isn't valid JSON so its skipped.

code=$?

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CONTRACTS_BASE=$(dirname $SCRIPT_DIR)
MONOREPO_BASE=$(dirname $(dirname $CONTRACTS_BASE))

for config in $CONTRACTS_BASE/deploy-config/*.json; do
    if grep -q "getting-started" <<< "$config"; then
      echo "Skipping getting-started.json"
      continue
    fi

    go run $MONOREPO_BASE/op-chain-ops/cmd/check-deploy-config/main.go --path $config
    [ $? -eq 0 ]  || code=$?
done

exit $code