Files
openstapps/packages/core/.gitlab-ci.yml

136 lines
2.3 KiB
YAML

image: registry.gitlab.com/openstapps/projectmanagement/node
before_script:
- npm install
stages:
- build
- review
- test
- audit
- deploy
- publish
build:
tags:
- performance
stage: build
script:
- npm run build
artifacts:
paths:
- lib
expire_in: 1 week
build-ts-3.8.3:
tags:
- performance
stage: build
script:
- npm uninstall typescript
- npm install typescript@3.8.3
- npm run build
docs_review:
dependencies:
- build
stage: review
script:
- npm run documentation
- ./node_modules/.bin/surge -p ./docs -d https://$CI_PROJECT_PATH_SLUG-$CI_ENVIRONMENT_SLUG.surge.sh/
when: manual
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
except:
- master
- develop
tags:
- secrecy
stop_review:
stage: review
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
audit:
stage: audit
script:
- npm audit
allow_failure: true
except:
- schedules
scheduled-audit:
stage: audit
script:
- npm audit --audit-level=high
only:
- schedules
test:
dependencies:
- build
stage: test
script:
- npm test
coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/'
artifacts:
paths:
- report
- coverage
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
mapping:
tags:
- performance
dependencies:
- build
stage: test
services:
- name: registry.gitlab.com/openstapps/database:latest
alias: elasticsearch
script:
- npm run mappings-integration
artifacts:
paths:
- lib
package:
dependencies:
- build
tags:
- secrecy
stage: publish
script:
- echo "//registry.npmjs.org/:_authToken=$NPM_AUTH_TOKEN" > ~/.npmrc
- npm publish
only:
- /^v[0-9]+.[0-9]+.[0-9]+$/
artifacts:
paths:
- lib
pages:
stage: deploy
script:
- npm run documentation
- mv docs public
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
artifacts:
paths:
- public