From 335ecadde10707db1182c57fdf21fdd3d8fa91dc Mon Sep 17 00:00:00 2001 From: Ricardo Freitas Date: Tue, 25 Oct 2016 10:22:38 +0100 Subject: [PATCH] fixed surge https certiticate issue --- deploy.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/deploy.sh b/deploy.sh index b76743a888..334f542299 100644 --- a/deploy.sh +++ b/deploy.sh @@ -12,7 +12,7 @@ DEPLOY_SUBDOMAIN_UNFORMATTED_LIST=() if [ "$TRAVIS_PULL_REQUEST" != "false" ] then - DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_PULL_REQUEST}.pr) + DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_PULL_REQUEST}-pr) elif [ -n "${TRAVIS_TAG// }" ] #TAG is not empty then LATEST_TAG=`git tag | sort -r | sed -n 1p` @@ -22,9 +22,9 @@ then DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(latest) fi - DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_TAG}.tag) + DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_TAG}-tag) else - DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_BRANCH}.branch) + DEPLOY_SUBDOMAIN_UNFORMATTED_LIST+=(${TRAVIS_BRANCH}-branch) fi @@ -32,14 +32,14 @@ for DEPLOY_SUBDOMAIN_UNFORMATTED in "${DEPLOY_SUBDOMAIN_UNFORMATTED_LIST[@]}" do echo $DEPLOY_SUBDOMAIN_UNFORMATTED - # replaces "/" with "." + # replaces "/" or "." with "-" # sed -r is only supported in linux, ref http://stackoverflow.com/a/2871217/689223 # Domain names follow the RFC1123 spec [a-Z] [0-9] [-] # The length is limited to 253 characters # https://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax - DEPLOY_SUBDOMAIN=`echo "$DEPLOY_SUBDOMAIN_UNFORMATTED" | sed -r 's/[\/]+/\./g'` + DEPLOY_SUBDOMAIN=`echo "$DEPLOY_SUBDOMAIN_UNFORMATTED" | sed -r 's/[\/|\.]+/\-/g'` - DEPLOY_DOMAIN=https://${DEPLOY_SUBDOMAIN}.${REPO_NAME}.${REPO_OWNER}.surge.sh + DEPLOY_DOMAIN=https://${DEPLOY_SUBDOMAIN}-${REPO_NAME}-${REPO_OWNER}.surge.sh surge --project ${DEPLOY_PATH} --domain $DEPLOY_DOMAIN;