-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
77 lines (73 loc) · 1.93 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
75
76
77
stages:
- test
- build
- update
unit-tests:
stage: test
cache:
paths:
- node_modules
image: registry.ik8s.ir/node:18-alpine
script:
- yarn
- yarn jest --coverage
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_BRANCH == "main"'
tags:
- novincloud-docker-runner
artifacts:
when: on_success
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura-coverage.xml
coverage: '/Lines\s*:\s*(\d+.?\d*)%/'
e2e-tests:
stage: test
image: registry.ik8s.ir/node:18-alpine
cache:
paths:
- node_modules
script:
- yarn
- yarn jest --version
- yarn jest --config ./test/jest-e2e.json
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH'
tags:
- novincloud-docker-runner
build-docker-image:
stage: build
script:
- echo $CI_REGISTRY
- docker build -t $CI_REGISTRY/$CI_PROJECT_NAME:$CI_COMMIT_TAG .
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- docker image push $CI_REGISTRY/$CI_PROJECT_NAME:$CI_COMMIT_TAG
- docker image prune -f
only:
- /^[0-9]+(?:.[0-9]+)+-(rc|stable)(.*)$/
tags:
- novincloud-runner
update-helm-release-candidate:
stage: update
variables:
IK8S_CI_IMAGE_NAME: '$CI_PROJECT_NAME'
IK8S_CI_IMAGE_TAG: '$CI_COMMIT_TAG'
IK8S_CI_TRIGGER: 'true'
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+(?:.[0-9]+)+-(rc)(.*)$/'
trigger:
project: ik8s/gitops
branch: staging
update-helm-stable-release:
stage: update
variables:
IK8S_CI_IMAGE_NAME: '$CI_PROJECT_NAME'
IK8S_CI_IMAGE_TAG: '$CI_COMMIT_TAG'
IK8S_CI_TRIGGER: 'true'
rules:
- if: '$CI_COMMIT_TAG =~ /^[0-9]+(?:.[0-9]+)+-(stable)(.*)$/'
trigger:
project: ik8s/gitops
branch: main