Files
openstapps/.gitlab-ci.yml
2021-04-27 15:23:43 +02:00

56 lines
1.0 KiB
YAML

image: registry.gitlab.com/openstapps/projectmanagement/node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- lib
- node_modules
stages:
- build
- test
- publish
build:
before_script:
- npm install
stage: build
script:
- npm run build
artifacts:
untracked: true
paths:
- node_modules/
only:
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
tags:
- docker
test:
stage: test
dependencies:
- build
script:
- npm test
tags:
- docker
publish:
image: registry.gitlab.com/openstapps/projectmanagement/builder
stage: publish
dependencies:
- test
- build
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH$CI_COMMIT_REF_NAME:latest .
- docker push $CI_REGISTRY_IMAGE/$REGISTRY_BRANCH$CI_COMMIT_REF_NAME:latest
only:
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
tags:
- docker