Fix caprover deploy

This commit is contained in:
Elia Bieri 2023-05-25 14:16:43 +02:00
parent ace5b5b21c
commit 827a074ffb
1 changed files with 4 additions and 4 deletions

View File

@ -16,10 +16,6 @@ echo "$BRANCH_NAME_SLUG"
DEFAULT_APP_NAME="vbv-$BRANCH_NAME_SLUG"
APP_NAME=${1:-$DEFAULT_APP_NAME}
# remove multiple dashes and make sure it does not end with a dash
APP_NAME=$(echo "$APP_NAME" | sed -E 's/-+/-/g')
APP_NAME=$(echo "$APP_NAME" | sed 's/-\+$//')
# shorten APP_NAME to 32 characters
# app names with more character seem to fail in some steps in CapRover
# CapRover generates longer names out from the app name and there
@ -29,6 +25,10 @@ if (( ${#APP_NAME} > 32 )); then
APP_NAME=$(echo -n "${APP_NAME:0:28}-${hash}")
fi
# remove multiple dashes and make sure it does not end with a dash
APP_NAME=$(echo "$APP_NAME" | sed -E 's/-+/-/g')
APP_NAME=$(echo "$APP_NAME" | sed 's/-\+$//')
echo "Deploy to $APP_NAME"
VITE_GRAPHQL_URL="/server/graphql/"