-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
50 lines (44 loc) · 1.22 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
image: node:latest
services:
cache:
key:
files:
- package.json
paths:
- node_modules
stages:
- build
- test
- upload
sast:
stage: test
include:
- template: Security/SAST.gitlab-ci.yml
build:
stage: build
script:
- npm install
- npm run build --if-present
test:
stage: test
script:
- npm run format
- npm run lint
- npm test
build image:
image: docker:20.10.10
services:
- docker:20.10.10-dind
rules:
- if: $CI_COMMIT_BRANCH == "main" || ($CI_PIPELINE_SOURCE == 'merge_request_event' && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" ))
script:
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER $CI_REGISTRY --password-stdin
- docker build -t $CI_REGISTRY_IMAGE .
- docker push $CI_REGISTRY_IMAGE
upload helmchart:
image: curlimages/curl:latest
stage: upload
rules:
- if: $CI_COMMIT_BRANCH == "main" || ($CI_PIPELINE_SOURCE == 'merge_request_event' && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main" ))
script:
- 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@sudoku-0.1.0.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'