Skip to content

Commit ec8c5d8

Browse files
committed
Fix create-log.sh shebang
set -o pipefail is a bash option. Not valid under sh
1 parent dd4b0e6 commit ec8c5d8

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

crates/ct_worker/scripts/create-log.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
set -e -o pipefail
44

@@ -9,6 +9,8 @@ if [ -z $ENV ] || [ -z $LOG_NAME ] || [ -z $LOCATION ] || [ -z $CLOUDFLARE_ACCOU
99
exit 1
1010
fi
1111

12+
WRANGLER_CONF=${WRANGLER_CONF:-wrangler.jsonc}
13+
1214
while true; do
1315
read -p "Do you want to proceed with ENV=${ENV}, LOG_NAME=${LOG_NAME}, LOCATION=${LOCATION}, CLOUDFLARE_ACCOUNT_ID=${CLOUDFLARE_ACCOUNT_ID}? (y/N) " yn
1416
case $yn in
@@ -19,21 +21,21 @@ while true; do
1921
done
2022

2123
# Create R2 bucket if it does not already exist
22-
npx wrangler r2 bucket create static-ct-public-${LOG_NAME} --location ${LOCATION}
24+
npx wrangler -e="${ENV}" -c "${WRANGLER_CONF}" r2 bucket create static-ct-public-${LOG_NAME} --location ${LOCATION}
2325

2426
# Create KV namespace if it does not already exist
25-
npx wrangler kv namespace create static-ct-cache-${LOG_NAME}
27+
npx wrangler -e="${ENV}" -c "${WRANGLER_CONF}" kv namespace create static-ct-cache-${LOG_NAME}
2628

2729
# Create witness and log signing keys if they do not already exist
2830
if npx wrangler -e=${ENV} secret list | grep -q WITNESS_KEY_${LOG_NAME}; then
2931
echo "WITNESS_KEY_${LOG_NAME} already exists"
3032
else
31-
openssl genpkey -algorithm ed25519 | npx wrangler -e=${ENV} secret put WITNESS_KEY_${LOG_NAME}
33+
openssl genpkey -algorithm ed25519 | npx wrangler -c "$WRANGLER_CONF" -e=${ENV} secret put WITNESS_KEY_${LOG_NAME}
3234
fi
3335
if npx wrangler -e=${ENV} secret list | grep -q SIGNING_KEY_${LOG_NAME}; then
3436
echo "SIGNING_KEY_${LOG_NAME} already exists"
3537
else
36-
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 | npx wrangler -e=${ENV} secret put SIGNING_KEY_${LOG_NAME}
38+
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 | npx wrangler -c "$WRANGLER_CONF" -e=${ENV} secret put SIGNING_KEY_${LOG_NAME}
3739
fi
3840

3941
echo "DONE"

0 commit comments

Comments
 (0)