coretraffic/.gitlab-ci.yml

113 lines
2.1 KiB
YAML
Raw Normal View History

2024-05-15 08:10:41 +00:00
# gitzone ci_docker
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci-cache/
key: '$CI_BUILD_STAGE'
before_script:
- npmci npm prepare
stages:
- security
- test
- release
- metadata
- pages
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- lossless
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- lossless
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- lossless
- docker
- notpriv
# ====================
# release stage
# ====================
release:
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
services:
- docker:stable-dind
stage: release
script:
- npmci node install stable
- npmci docker login
- npmci docker build
- npmci docker test
- npmci docker push registry.gitlab.com
only:
- tags
tags:
- lossless
- docker
- priv
# ====================
# metadata stage
# ====================
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker