forked from telekom-mms/cmcc-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
103 lines (91 loc) · 3.53 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
import java.nio.charset.StandardCharsets
plugins {
id 'org.springframework.boot' version '2.6.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'com.google.cloud.tools.jib' version '3.2.1'
}
group = 'com.tsystemsmms'
version = '0.0.1-SNAPSHOT'
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
}
compileJava {
options.deprecation = true
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'io.javaoperatorsdk:operator-framework-spring-boot-starter:2.3.0'
implementation 'org.bouncycastle:bcpkix-jdk15on:1.70'
// required for the fabric8 k8s client to grok k3d certificates
implementation 'org.springframework.boot:spring-boot-starter'
// developmentOnly 'org.springframework.boot:spring-boot-devtools'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
compileOnly 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'io.fabric8:crd-generator-apt:5.12.2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.javaoperatorsdk:operator-framework-spring-boot-starter-test:2.3.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/openjdk:11-jre-slim"
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/T-Systems-MMS/cmcc-operator",
"org.opencontainers.image.licenses" : "Apache-2.0",
"org.opencontainers.image.source" : "https://github.com/T-Systems-MMS/cmcc-operator",
"org.opencontainers.image.title" : "CoreMedia Content Cloud Kubernetes Operator",
"org.opencontainers.image.url" : "https://github.com/T-Systems-MMS/cmcc-operator",
"org.opencontainers.image.vendor" : "T-Systems Multimedia Solutions GmbH"
]
}
}