Commit 326cd7e3 authored by Vincent's avatar Vincent

Merge branch 'ci' into 'master'

Add CI deployment

See merge request !1
parents 57ca7f0a 1c1624f6
Pipeline #25484697 passed with stage
in 3 minutes and 15 seconds
image: node:8
stages:
- review
- deploy
variables:
REPO_NAME: whereisscihubnow
start_review:
stage: review
script:
- npm install -g --unsafe-perm now
- URL=$(now --public -t ${NOW_TOKEN} -n ${REPO_NAME}-${CI_COMMIT_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_COMMIT_REF_SLUG}.now.sh
environment:
name: review/$CI_BUILD_REF_NAME
url: https://$REPO_NAME-$CI_COMMIT_REF_SLUG.now.sh
on_stop: stop_review
only:
- branches
except:
- master
stop_review:
stage: review
script:
- npm install -g --unsafe-perm now
- now --public rm -t ${NOW_TOKEN} -y ${CI_COMMIT_REF_SLUG}
when: manual
environment:
name: review/$CI_BUILD_REF_NAME
action: stop
only:
- branches
except:
- master
start_production:
stage: deploy
script:
- npm install -g --unsafe-perm now
- URL=$(now --public -t ${NOW_TOKEN} -n ${REPO_NAME}-${CI_COMMIT_REF_SLUG})
- NOW_URL=$(echo ${URL} | sed s/'http:\/\/'/''/g | sed s/'https:\/\/'//g)
- now -t ${NOW_TOKEN} alias set ${NOW_URL} whereisscihub.now.sh
environment:
name: production
url: https://whereisscihub.now.sh
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment