Skip to content

Commit 04b5b65

Browse files
committed
More curl request fixes
1 parent a9d0cfa commit 04b5b65

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/release/tps_check_lock

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
set -eu
33
set -o pipefail
44

5+
if [ -z "${TPS_HOSTNAME:-}" ]; then
6+
TPS_HOSTNAME="tps.heroku.tools"
7+
fi
8+
59
if [ -z "${TPS_API_TOKEN:-}" ]; then
610
echo "Requires environment variable: TPS_API_TOKEN" >&2
711
exit 1
@@ -23,16 +27,17 @@ fi
2327
response_status=0
2428

2529
tpsGetLock() {
26-
response_status="$(curl --write-out '%{http_code}' \
30+
response_status="$(curl --silent \
31+
--write-out '%{http_code}' \
2732
-X PUT \
28-
-H "Accept: application/json" \
33+
-H "Accept: */*" \
2934
-H "Content-Type: application/json" \
30-
-H "Authorization: Token ${TPS_API_TOKEN}" \
35+
-H "Authorization: Bearer ${TPS_API_TOKEN}" \
3136
-d "{\"lock\": {\"sha\": \"${release_sha}\", \"component_slug\": \"${component_slug}\"}}" \
32-
https://tps.heroku.tools/api/ctc)"
37+
https://${TPS_HOSTNAME}/api/ctc)"
3338
}
3439

35-
echo "Requesting deployment lock from tps.heroku.tools" >&2
40+
echo "Requesting deployment lock from ${TPS_HOSTNAME}" >&2
3641
retry_count=0
3742
set +e
3843
tpsGetLock

0 commit comments

Comments
 (0)