Files
openstapps/.gitlab-ci.yml
2019-01-25 17:46:44 +01:00

66 lines
1.2 KiB
YAML

image: registry.gitlab.com/openstapps/projectmanagement/node
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules
stages:
- build
- test
- deploy
- publish
build:build:
stage: build
script:
- npm install
- npm run build
artifacts:
paths:
- lib
expire_in: 1 week
test:audit:
stage: test
script:
- npm audit
test:mocha:
stage: test
script:
- npm test
publish:image:
image: docker:stable
dependencies:
- build:build
- test:mocha
- test:audit
stage: publish
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/api/copy:$CI_BUILD_REF_NAME .
- docker push registry.gitlab.com/openstapps/api/copy:$CI_BUILD_REF_NAME
- docker build -t registry.gitlab.com/openstapps/api/copy:latest .
- docker push registry.gitlab.com/openstapps/api/copy:latest
tags:
- docker
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
deploy:pages:
stage: deploy
script:
- npm run documentation
- mv docs public
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
artifacts:
paths:
- public