-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
64 lines (57 loc) · 1.32 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
image: docker:latest
stages:
- test
- scan
services:
- docker:dind
variables:
DOCKER_HOST: "tcp://docker:2375"
DOCKER_TLS_CERTDIR: ""
DOCKER_DRIVER: overlay2
CONTAINER_RELEASE_IMAGE: beo1975/ronja-server:latest
scan-code:
stage: .pre
image:
name: "zricethezav/gitleaks:latest"
entrypoint: [""]
script:
- gitleaks detect --verbose --redact --no-git --source="$CI_PROJECT_DIR"
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
tags:
- docker
scan-image:
stage: scan
image:
name: "aquasec/trivy:latest"
entrypoint: [""]
script:
- trivy i --no-progress --ignore-unfixed --clear-cache --exit-code 1 $CONTAINER_RELEASE_IMAGE
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
tags:
- docker
scan-vulnerabilities:
stage: .pre
image:
name: "aquasec/trivy:latest"
entrypoint: [""]
script:
- trivy fs --no-progress --ignore-unfixed --exit-code 0 $CI_PROJECT_DIR
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
tags:
- docker
test-code:
image: eclipse-temurin:21.0.5_11-jdk-jammy
stage: test
script:
- chmod +x gradlew
- ./gradlew jacocoTestReport
- cat build/reports/jacoco/test/html/index.html
coverage: "/Total.*?([0-9]{1,3})%/"
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
tags:
- gitlab-org-docker