mirror of
https://github.com/d0zingcat/ghost-docker.git
synced 2026-05-13 23:16:44 +00:00
Simplify TB initial setup
no ref - By outputting the tokens in the format the `.env` file expects this greatly simplifies the initial setup by just makign it copy -> paste able - This will mean users don't need to load up the UI and copy/paste tokens at all and can do the whole setup (after they've signed up for TB) from the CLI
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
# Get token from .tinyb JSON file
|
||||
USER_TOKEN=$(jq -r '.token' .tinyb)
|
||||
echo "User token: $USER_TOKEN"
|
||||
|
||||
if [ -z "$USER_TOKEN" ] || [ "$USER_TOKEN" = "null" ]; then
|
||||
echo "Error: Could not find token in .tinyb file"
|
||||
@@ -11,7 +10,7 @@ fi
|
||||
|
||||
# Get host from .tinyb JSON file
|
||||
HOST=$(jq -r '.host' .tinyb)
|
||||
echo "Host: $HOST"
|
||||
echo "TINYBIRD_API_URL=$HOST"
|
||||
|
||||
if [ -z "$HOST" ] || [ "$HOST" = "null" ]; then
|
||||
echo "Error: Could not find host in .tinyb file"
|
||||
@@ -20,7 +19,7 @@ fi
|
||||
|
||||
# Get id from .tinyb JSON file
|
||||
WORKSPACE_ID=$(jq -r '.id' .tinyb)
|
||||
echo "Workspace ID: $WORKSPACE_ID"
|
||||
echo "TINYBIRD_WORKSPACE_ID=$WORKSPACE_ID"
|
||||
|
||||
if [ -z "$WORKSPACE_ID" ] || [ "$WORKSPACE_ID" = "null" ]; then
|
||||
echo "Error: Could not find id in .tinyb file"
|
||||
@@ -37,5 +36,5 @@ ADMIN_TOKEN=$(echo "$RESPONSE" | jq -r '.tokens[] | select(.name == "admin token
|
||||
TRACKER_TOKEN=$(echo "$RESPONSE" | jq -r '.tokens[] | select(.name == "tracker") | .token')
|
||||
|
||||
# Echo the tokens as proof of concept
|
||||
echo "Admin token: $ADMIN_TOKEN"
|
||||
echo "Tracker token: $TRACKER_TOKEN"
|
||||
echo "TINYBIRD_ADMIN_TOKEN=$ADMIN_TOKEN"
|
||||
echo "TINYBIRD_TRACKER_TOKEN=$TRACKER_TOKEN"
|
||||
|
||||
Reference in New Issue
Block a user