Repository navigation
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
75 lines (67 loc) · 2.06 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
75 lines (67 loc) · 2.06 KB
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
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/user/application_security/sast/#available-cicd-variables
# Secret Detection customization: https://docs.gitlab.com/user/application_security/secret_detection/pipeline/configure/
# Dependency Scanning customization: https://docs.gitlab.com/user/application_security/dependency_scanning/#customizing-analyzer-behavior
# Container Scanning customization: https://docs.gitlab.com/user/application_security/container_scanning/#customizing-analyzer-behavior
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ci/variables/#cicd-variable-precedence
stages:
- test
- build
- publish
variables:
# Disabling the daemon and enabling parallel execution saves compute minutes
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dorg.gradle.parallel=true"
SECRET_DETECTION_ENABLED: 'true'
# Shared configuration for all Java/Gradle jobs
.gradle-setup:
image: eclipse-temurin:17-jdk
before_script:
- chmod +x ./gradlew
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- .gradle/caches/
- .gradle/wrapper/
# --- Security Analysis ---
include:
- template: Security/SAST.gitlab-ci.yml
- template: Security/Secret-Detection.gitlab-ci.yml
sast:
stage: test
rules:
- when: manual
allow_failure: true
secret_detection:
stage: test
rules:
- when: manual
allow_failure: true
# --- Build Stage ---
# Set to manual
build-modules:
extends: .gradle-setup
stage: build
parallel:
matrix:
- MODULE: [internals, api, loader, gradle-plugin, mod-testing]
script:
- ./gradlew :$MODULE:build
rules:
- when: manual
artifacts:
name: "weave-$MODULE-$CI_COMMIT_SHORT_SHA"
paths:
- "$MODULE/build/libs/"
expire_in: 1 week
# --- Publish Stage ---
publish-to-registry:
extends: .gradle-setup
stage: publish
needs: []
script:
- ./gradlew publishToGitLabPackageRegistry
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: manual
- when: never