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

54 lines
1009 B
YAML

image: registry.gitlab.com/openstapps/projectmanagement/node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- lib
- node_modules
before_script:
- npm install
stages:
- build
- test
- publish
build:
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
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