Skip to content

Commit

Permalink
use release version, dyno name
Browse files Browse the repository at this point in the history
  • Loading branch information
uchouhan committed Apr 10, 2024
1 parent 4da928f commit 986bd88
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bin/heroku-tailscale-start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,20 @@ if [ -z "$TAILSCALE_AUTH_KEY" ]; then
else
log "Starting Tailscale"

# Only use the first 8 characters of the commit sha.
# Swap the . and _ in the dyno with a - since tailscale doesn't
# allow for periods.
DYNO=${DYNO//./-}
DYNO=${DYNO//_/-}

if [ -z "$TAILSCALE_HOSTNAME" ]; then
if [ -z "$HEROKU_APP_NAME" ]; then
tailscale_hostname=$(hostname)
else
# Only use the first 8 characters of the commit sha.
# Swap the . and _ in the dyno with a - since tailscale doesn't
# allow for periods.
DYNO=${DYNO//./-}
DYNO=${DYNO//_/-}
tailscale_hostname=${HEROKU_SLUG_COMMIT:0:8}"-$DYNO-$HEROKU_APP_NAME"
fi
else
tailscale_hostname="$TAILSCALE_HOSTNAME-${HEROKU_SLUG_COMMIT:0:8}"
tailscale_hostname="$TAILSCALE_HOSTNAME-$HEROKU_RELEASE_VERSION-$DYNO"
fi
log "Using Tailscale hostname=$tailscale_hostname"

Expand Down

0 comments on commit 986bd88

Please sign in to comment.