Files
openstapps/.gitlab-ci.yml
2019-04-12 12:12:27 +02:00

99 lines
1.7 KiB
YAML

image: registry.gitlab.com/openstapps/app
stages:
- setup
- build
- test
- docs
- deploy
setup:
image: registry.gitlab.com/openstapps/projectmanagement/builder
stage: setup
only:
- schedules
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
- docker build -t registry.gitlab.com/openstapps/app .
- docker push registry.gitlab.com/openstapps/app
tags:
- docker
build:
stage: build
script:
- npm install
- npm run build
artifacts:
paths:
- node_modules
- www
unit:
stage: test
script:
- npm run test -- --watch=false --no-progress --code-coverage
artifacts:
paths:
- coverage
e2e:
stage: test
script:
- npm run e2e
audit:
stage: test
script:
- npm audit
allow_failure: true
except:
- schedules
scheduled-audit:
stage: test
script:
- npm audit
only:
- schedules
pages:
stage: docs
script:
- npm run documentation
- mv docs public
only:
- master
artifacts:
paths:
- public
review:
stage: deploy
script:
- npm run build:prod
- ./node_modules/.bin/surge -p ./www -d https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
environment:
name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME
url: https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
on_stop: stop_review
tags:
- secrecy
stop_review:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- ./node_modules/.bin/surge teardown $CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh
when: manual
environment:
name: review/$CI_PROJECT_PATH_SLUG-$CI_COMMIT_REF_NAME
action: stop
tags:
- secrecy