mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-11 08:46:16 +00:00
125 lines
2.5 KiB
YAML
125 lines
2.5 KiB
YAML
image: registry.gitlab.com/openstapps/projectmanagement/node
|
|
|
|
default:
|
|
tags:
|
|
- performance
|
|
|
|
before_script:
|
|
- npm ci
|
|
|
|
stages:
|
|
- build
|
|
- test
|
|
- audit
|
|
- publish
|
|
- deploy
|
|
|
|
build:
|
|
stage: build
|
|
script:
|
|
- npm run build
|
|
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
|
|
|
|
audit:
|
|
stage: audit
|
|
script:
|
|
- npm audit
|
|
allow_failure: true
|
|
except:
|
|
- schedules
|
|
|
|
scheduled-audit:
|
|
stage: audit
|
|
script:
|
|
- npm audit --audit-level=high
|
|
only:
|
|
- schedules
|
|
|
|
unit:
|
|
stage: test
|
|
script:
|
|
- npm test
|
|
coverage: '/Statements[^:]*\:[^:]*\s+([\d\.]+)%/'
|
|
artifacts:
|
|
reports:
|
|
coverage_report:
|
|
coverage_format: cobertura
|
|
path: coverage/cobertura-coverage.xml
|
|
|
|
pages:
|
|
stage: deploy
|
|
script:
|
|
- npm run documentation
|
|
- mv docs public
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
|
|
docker image:
|
|
image: registry.gitlab.com/openstapps/projectmanagement/builder:latest
|
|
dependencies:
|
|
- build
|
|
stage: publish
|
|
variables:
|
|
DOCKER_DRIVER: overlay2
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- export VERSION=$(node -p "require('./package.json').version")
|
|
- export CORE_VERSION=$(openstapps-projectmanagement get-used-version @openstapps/core)
|
|
- export IMAGETAG_BASE=$CI_REGISTRY_IMAGE/cli
|
|
- export IMAGETAG_CORE_VERSION=$IMAGETAG_BASE:core-$CORE_VERSION
|
|
- export IMAGETAG_VERSION=$IMAGETAG_BASE:$VERSION
|
|
- export IMAGETAG_LATEST=$IMAGETAG_BASE:latest
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
- docker build -t $IMAGETAG_LATEST -t $IMAGETAG_VERSION -t $IMAGETAG_CORE_VERSION .
|
|
- docker push $IMAGETAG_BASE
|
|
tags:
|
|
- secrecy
|
|
only:
|
|
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
|
|
branch image:
|
|
image: registry.gitlab.com/openstapps/projectmanagement/builder:latest
|
|
stage: publish
|
|
dependencies:
|
|
- build
|
|
artifacts:
|
|
untracked: true
|
|
variables:
|
|
DOCKER_DRIVER: overlay2
|
|
services:
|
|
- docker:dind
|
|
script:
|
|
- export IMAGETAG_BASE=$CI_REGISTRY_IMAGE/cli
|
|
- export IMAGETAG_BRANCH=$IMAGETAG_BASE:$CI_COMMIT_REF_SLUG
|
|
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
|
|
- docker build -t $IMAGETAG_BRANCH .
|
|
- docker push $IMAGETAG_BASE
|
|
except:
|
|
- /(^v[0-9]+\.[0-9]+\.[0-9]+$|^master$|^develop$)/
|
|
only:
|
|
- branches
|
|
when: manual
|
|
tags:
|
|
- secrecy
|