-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
74 lines (66 loc) · 2.26 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
stages:
- install
- test
- containerize
- verify
- release
- pages
include:
- remote: https://gitlab.com/TIBHannover/gitlab-ci-templates/raw/master/templates/Docker.gitlab-ci.yml
- remote: https://gitlab.com/TIBHannover/gitlab-ci-templates/raw/master/templates/Docker-Release.gitlab-ci.yml
- template: Security/Container-Scanning.gitlab-ci.yml
- template: Dependency-Scanning.gitlab-ci.yml
install:
image: node:lts-buster
stage: install
script:
- npm install
artifacts:
paths:
- node_modules/
jest:
image: node:lts-buster
stage: test
script:
- cp default.env .env
- npm run test:ci
artifacts:
when: always
reports:
junit:
- junit.xml
container_scanning:
stage: verify
variables:
CS_ANALYZER_IMAGE: registry.gitlab.com/security-products/container-scanning/grype:4
# Change image name to match our repository naming convention
CI_APPLICATION_REPOSITORY: $CI_REGISTRY_IMAGE
dependency_scanning:
stage: verify
deploy:incubating:
stage: release
image: buildpack-deps:buster-curl
script:
- curl --fail -X POST -F "token=$PIPELINE_TRIGGER_TOKEN" -F "ref=master" -F "variables[ORKG_COMPONENT_NAME]=orkg-frontend" -F "variables[ORKG_COMPONENT_REF_NAME]=$CI_COMMIT_REF_NAME" https://git.tib.eu/api/v4/projects/1317/trigger/pipeline
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
deploy:release:
stage: release
image: buildpack-deps:buster-curl
script:
- curl --fail -X POST -F "token=$PIPELINE_TRIGGER_TOKEN" -F "ref=master" -F "variables[ORKG_COMPONENT_NAME]=orkg-frontend" -F "variables[ORKG_COMPONENT_REF_NAME]=$CI_COMMIT_REF_NAME" -F "variables[ORKG_COMPONENT_REF_NAME]=release" -F "variables[ORKG_COMPONENT_RELEASE_VERSION]=$CI_COMMIT_TAG" https://git.tib.eu/api/v4/projects/1317/trigger/pipeline
rules:
- if: $CI_COMMIT_TAG
# deploy storybook to Gitlab pages
pages:
image: node:lts-buster
stage: pages
script:
- rm -rf public # remove the currently existing 'public' folder that contains static files for running the frontend
- mkdir -p public/storybook
- npm run build-storybook
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH