Skip to content

Commit 07bffd6

Browse files
authored
Merge pull request #18 from jonico/better-wording-handling-edge-cases
Better handling of edge cases
2 parents a7f5ea3 + 686dac1 commit 07bffd6

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

.pscale/cli-helper-scripts/ps-create-helper-functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ function create-deployment {
220220
echo "Check out the deploy request status at $deploy_request"
221221
exit 5
222222
else
223-
echo "Check out the deploy request merged at $deploy_request"
223+
echo "Check out the deploy request at $deploy_request"
224224
fi
225225

226226
}

.pscale/cli-helper-scripts/set-db-and-org-and-branch-name.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11

22
# Set DB_NAME unless it is already set
3-
export DB_NAME=${DB_NAME:-example-db-${GITHUB_USER}}
3+
export DB_NAME=${DB_NAME:-harry-potter-${GITHUB_USER:-db}}
44
echo "Using DB name ${DB_NAME}"
55

66
# set org name to first org the user has access to unless it is already set in ORG_NAME
77
if [ -z "${ORG_NAME}" ]; then
88
export ORG_NAME=`pscale org list --format json | jq -r ".[0].name"`
9-
# check exit code and name of the org
9+
# check exit code
1010
if [ $? -ne 0 ] || [ -z "${ORG_NAME}" ]; then
1111
echo "Error: Failed to get PlanetScale org name, please set ORG_NAME explicitly or use Web based SSO, service tokens do not allow to list orgs."
1212
exit 1
1313
fi
14+
# if org name is set to planetscale, we will set org name to planetscale-demo instead
15+
if [ "${ORG_NAME}" = "planetscale" ]; then
16+
export ORG_NAME="planetscale-demo"
17+
fi
1418
fi
19+
1520
echo "Using org name ${ORG_NAME}"
1621

1722
export BRANCH_NAME=${BRANCH_NAME:-"main"}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
# Set DB_NAME unless it is already set
3-
export DB_NAME=${DB_NAME:-matrix-demos-${GITHUB_USER}}
3+
export DB_NAME=${DB_NAME:-example-db-${GITHUB_USER}}
44
# Set org name unless it is already set
55
export ORG_NAME=${ORG_NAME:-"planetscale-demo"}

.pscale/cli-helper-scripts/wait-for-deploy-request-merged.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ function wait_for_deploy_request_merged {
3737
echo "Deploy request $number is not ready after $retries retries. Exiting..."
3838
return 2
3939
fi
40-
echo "Deploy-request $number is not merged yet. Current status:"
40+
echo "Deploy-request $number is not deployed yet. Current status:"
4141
echo "show vitess_migrations\G" | pscale shell "$db" main --org "$org"
4242
echo "Retrying in $wait seconds..."
4343
sleep $wait
44-
elif [ "$output" = "\"complete\"" ]; then
45-
echo "Deploy-request $number has been merged successfully."
44+
elif [ "$output" = "\"complete\"" ] || [ "$output" = "\"complete_pending_revert\"" ]; then
45+
echo "Deploy-request $number has been deployed successfully."
4646
return 0
4747
else
4848
echo "Deploy-request $number with unknown status: $output"
4949
return 3
5050
fi
5151
done
52-
}
52+
}

0 commit comments

Comments
 (0)