Skip to content

Commit ab05081

Browse files
committed
devops: Fix incorrect quoting
1 parent 4af7bcb commit ab05081

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

devops/create-new-statbus-installation.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ ssh $DEPLOYMENT_USER@$HOST bash << UPDATE_SETTINGS
211211
cd ~/statbus
212212
213213
# Only update port offset if different
214-
current_offset=\$(grep '^DEPLOYMENT_SLOT_PORT_OFFSET=' .env.config | cut -d'=' -f2 | tr -d '"')
214+
current_offset=\$(grep '^DEPLOYMENT_SLOT_PORT_OFFSET=' .env.config | cut -d'=' -f2)
215215
if [ "\$current_offset" != "$OFFSET" ]; then
216216
sed -i "s/DEPLOYMENT_SLOT_PORT_OFFSET=.*/DEPLOYMENT_SLOT_PORT_OFFSET=$OFFSET/" .env.config
217217
echo "Updated port offset to $OFFSET"
@@ -220,35 +220,35 @@ ssh $DEPLOYMENT_USER@$HOST bash << UPDATE_SETTINGS
220220
fi
221221
222222
# Only update slot name if different
223-
current_name=\$(grep '^DEPLOYMENT_SLOT_NAME=' .env.config | cut -d'=' -f2 | tr -d '"')
223+
current_name=\$(grep '^DEPLOYMENT_SLOT_NAME=' .env.config | cut -d'=' -f2)
224224
if [ "\$current_name" != "$DEPLOYMENT_SLOT_NAME" ]; then
225-
sed -i "s/DEPLOYMENT_SLOT_NAME=.*/DEPLOYMENT_SLOT_NAME=\"$DEPLOYMENT_SLOT_NAME\"/" .env.config
225+
sed -i "s/DEPLOYMENT_SLOT_NAME=.*/DEPLOYMENT_SLOT_NAME=$DEPLOYMENT_SLOT_NAME/" .env.config
226226
echo "Updated slot name to $DEPLOYMENT_SLOT_NAME"
227227
else
228228
echo "Slot name is already $DEPLOYMENT_SLOT_NAME"
229229
fi
230230
231231
# Only update slot code if different
232-
current_code=\$(grep '^DEPLOYMENT_SLOT_CODE=' .env.config | cut -d'=' -f2 | tr -d '"')
232+
current_code=\$(grep '^DEPLOYMENT_SLOT_CODE=' .env.config | cut -d'=' -f2)
233233
if [ "\$current_code" != "$DEPLOYMENT_SLOT_CODE" ]; then
234-
sed -i "s/DEPLOYMENT_SLOT_CODE=.*/DEPLOYMENT_SLOT_CODE=\"$DEPLOYMENT_SLOT_CODE\"/" .env.config
234+
sed -i "s/DEPLOYMENT_SLOT_CODE=.*/DEPLOYMENT_SLOT_CODE=$DEPLOYMENT_SLOT_CODE/" .env.config
235235
echo "Updated slot code to $DEPLOYMENT_SLOT_CODE"
236236
else
237237
echo "Slot code is already $DEPLOYMENT_SLOT_CODE"
238238
fi
239239
240240
# Only update URLs if different
241-
current_statbus_url=\$(grep '^STATBUS_URL=' .env.config | cut -d'=' -f2 | tr -d '"')
241+
current_statbus_url=\$(grep '^STATBUS_URL=' .env.config | cut -d'=' -f2)
242242
if [ "\$current_statbus_url" != "https://www.$DOMAIN" ]; then
243-
sed -i "s#STATBUS_URL=.*#STATBUS_URL=\"https://www.$DOMAIN\"#" .env.config
243+
sed -i "s#STATBUS_URL=.*#STATBUS_URL=https://www.$DOMAIN#" .env.config
244244
echo "Updated StatBus URL"
245245
else
246246
echo "StatBus URL is already https://www.$DOMAIN"
247247
fi
248248
249-
current_supabase_url=\$(grep '^BROWSER_SUPABASE_URL=' .env.config | cut -d'=' -f2 | tr -d '"')
249+
current_supabase_url=\$(grep '^BROWSER_SUPABASE_URL=' .env.config | cut -d'=' -f2)
250250
if [ "\$current_supabase_url" != "https://api.$DOMAIN" ]; then
251-
sed -i "s#BROWSER_SUPABASE_URL=.*#BROWSER_SUPABASE_URL=\"https://api.$DOMAIN\"#" .env.config
251+
sed -i "s#BROWSER_SUPABASE_URL=.*#BROWSER_SUPABASE_URL=https://api.$DOMAIN#" .env.config
252252
echo "Updated Supabase URL"
253253
else
254254
echo "Supabase URL is already https://api.$DOMAIN"
@@ -264,7 +264,7 @@ ssh $DEPLOYMENT_USER@$HOST bash << UPDATE_SETTINGS
264264
fi
265265
266266
# Check and update API keys from statbus_dev if defaults are present
267-
current_seq_key=\$(grep '^SEQ_API_KEY=' .env.config | cut -d'=' -f2 | tr -d '"')
267+
current_seq_key=\$(grep '^SEQ_API_KEY=' .env.config | cut -d'=' -f2)
268268
if [ "\$current_seq_key" = "secret_seq_api_key" ]; then
269269
dev_seq_key=\$(grep '^SEQ_API_KEY=' /home/statbus_dev/statbus/.env.config | cut -d'=' -f2)
270270
sed -i "s#SEQ_API_KEY=.*#SEQ_API_KEY=\$dev_seq_key#" .env.config
@@ -273,7 +273,7 @@ ssh $DEPLOYMENT_USER@$HOST bash << UPDATE_SETTINGS
273273
echo "SEQ_API_KEY already configured with non-default value"
274274
fi
275275
276-
current_slack_token=\$(grep '^SLACK_TOKEN=' .env.config | cut -d'=' -f2 | tr -d '"')
276+
current_slack_token=\$(grep '^SLACK_TOKEN=' .env.config | cut -d'=' -f2)
277277
if [ "\$current_slack_token" = "secret_slack_api_token" ]; then
278278
dev_slack_token=\$(grep '^SLACK_TOKEN=' /home/statbus_dev/statbus/.env.config | cut -d'=' -f2)
279279
sed -i "s#SLACK_TOKEN=.*#SLACK_TOKEN=\$dev_slack_token#" .env.config

0 commit comments

Comments
 (0)