-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle
112 lines (99 loc) · 3.77 KB
/
build.gradle
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import java.nio.charset.StandardCharsets
plugins {
id 'org.springframework.boot' version '2.7.18'
id 'io.spring.dependency-management' version '1.1.6'
id 'java'
id 'com.google.cloud.tools.jib' version '3.4.3'
}
group = 'com.tsystemsmms'
version = '0.0.1-SNAPSHOT'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
repositories {
mavenCentral()
}
compileJava {
options.deprecation = true
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter:3.3.2'
// developmentOnly 'org.springframework.boot:spring-boot-devtools:3.2.0'
implementation 'org.springframework.boot:spring-boot-starter-actuator:3.3.2'
implementation 'org.springframework.boot:spring-boot-starter-web:3.3.2'
implementation 'io.javaoperatorsdk:operator-framework-spring-boot-starter:5.5.0'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.70'
// required for the fabric8 k8s client to grok k3d certificates
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor:3.3.2'
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'io.fabric8:crd-generator-apt:6.13.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.springframework.boot:spring-boot-starter-test:3.3.2'
testImplementation 'io.javaoperatorsdk:operator-framework-spring-boot-starter-test:5.5.0'
}
tasks.named('test') {
useJUnitPlatform()
}
task copyCrd(type: Copy) {
from('build/classes/java/main/META-INF/fabric8/coremediacontentclouds.cmcc.tsystemsmms.com-v1.yml') {
rename '.*', 'cmcc-crd.yaml'
}
into 'k8s'
}
def updateHelmCharCrd = tasks.register('updateHelmCharCrd') {
inputs.files('build/classes/java/main/META-INF/fabric8/coremediacontentclouds.cmcc.tsystemsmms.com-v1.yml')
outputs.files('charts/cmcc-operator/templates/crd.yaml')
doLast {
outputs.files.singleFile.withOutputStream { out ->
out.write('{{- if .Values.cmcc.useCrd }}\n'.getBytes(StandardCharsets.UTF_8))
for ( file in inputs.files ) file.withInputStream { out << it << '\n' }
out.write('{{- end }}\n'.getBytes(StandardCharsets.UTF_8))
}
}
}
build.finalizedBy(copyCrd)
build.finalizedBy(updateHelmCharCrd)
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
jib {
from {
image = "docker.io/library/amazoncorretto:17"
platforms {
platform {
architecture = 'amd64'
os = 'linux'
}
platform {
architecture = 'arm64'
os = 'linux'
}
}
}
to {}
container {
labels = [
"org.opencontainers.image.description" : "A Kubernetes operator that installs and configures a CoreMedia Content Cloud installation in a cluster.",
"org.opencontainers.image.documentation": "https://github.com/Telekom-MMS/cmcc-operator",
"org.opencontainers.image.licenses" : "Apache-2.0",
"org.opencontainers.image.source" : "https://github.com/Telekom-MMS/cmcc-operator",
"org.opencontainers.image.title" : "CoreMedia Content Cloud Kubernetes Operator",
"org.opencontainers.image.url" : "https://github.com/Telekom-MMS/cmcc-operator",
"org.opencontainers.image.vendor" : "T-Systems Multimedia Solutions GmbH"
]
user = 1000
}
}