diff --git a/source.yml b/source.yml index b3660bf..9530f05 100644 --- a/source.yml +++ b/source.yml @@ -96,6 +96,12 @@ jobs: echo "export SUBDOMAIN=`echo $CIRCLE_BRANCH | shasum | awk '{print $1}' | head -c 6`" >> $CIRCLE_BUILD_NUM echo "export CONTAINER=$CIRCLE_PROJECT_REPONAME-\$BRANCH" >> $CIRCLE_BUILD_NUM echo "export DIRECTORY=$CIRCLE_PROJECT_REPONAME/\$BRANCH" >> $CIRCLE_BUILD_NUM + - run: + name: Write Preview URL to a persisted file + command: | + source $CIRCLE_BUILD_NUM + mkdir -p workspace + echo "https://$SUBDOMAIN.<< parameters.domain >>" > workspace/preview-url - run: name: Notify Preview Deploy Started command: | @@ -141,3 +147,7 @@ jobs: ssh << parameters.user >>@<< parameters.server >> "docker ps | grep $CIRCLE_PROJECT_REPONAME | grep -vE '`cat grep_regex`'" | awk '{print $2}' > old_containers ssh << parameters.user >>@<< parameters.server >> "docker rm -f "`cat old_containers`"" ssh << parameters.user >>@<< parameters.server >> "rm -fr "`cat old_containers | sed "s/$CIRCLE_PROJECT_REPONAME-/$CIRCLE_PROJECT_REPONAME\//g"`"" + - persist_to_workspace: + root: workspace + paths: + - preview-url