Skip to content

Instantly share code, notes, and snippets.

@hugomd
Last active December 24, 2017 15:03
Show Gist options
  • Save hugomd/8831247d8b8549c981feeaa29b1893b4 to your computer and use it in GitHub Desktop.
Save hugomd/8831247d8b8549c981feeaa29b1893b4 to your computer and use it in GitHub Desktop.
image: node
stages:
- review
variables:
REPO_NAME: now-review-app
start_review:
stage: review
script:
- npm install -g now --silent
- URL=$(now --static -t ${NOW_TOKEN} ./src -n ${REPO_NAME}-${CI_BUILD_REF_SLUG})
- NOW_URL=$(echo ${URL} | sed s/'http:\/\/'/''/g | sed s/'https:\/\/'//g)
- now -t ${NOW_TOKEN} alias set ${NOW_URL} ${REPO_NAME}-${CI_BUILD_REF_SLUG}.now.sh
environment:
name: review/$CI_BUILD_REF_NAME
url: https://$REPO_NAME-$CI_BUILD_REF_SLUG.now.sh
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
stage: review
script:
- npm install -g now --silent
- now rm -t ${NOW_TOKEN} -y ${CI_BUILD_REF_SLUG}
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- branches
except:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment