-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
106 lines (89 loc) · 3.76 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
plugins {
id 'org.springframework.boot' version '2.6.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id 'com.bmuschko.docker-spring-boot-application' version '7.3.0'
id 'net.nemerosa.versioning' version '2.15.1'
}
group = 'org.eclipse.graphene'
version = '3.14'
sourceCompatibility = '17'
println 'build revision: '+versioning.info.full+versioning.info.dirty
repositories {
mavenCentral()
maven {
url "https://nexus.acumos.org/content/repositories/releases/"
}
maven {
url "https://cicd.ai4eu-dev.eu:7443/repository/maven-releases/"
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'ai4eu.common-dataservice:cmn-data-svc-client:3.2.0-ai4eu-v1'
implementation 'org.acumos.acumos-nexus-client:acumos-nexus-client:2.2.0'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.13.2'
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.1.3'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}
tasks.withType(JavaCompile) {
options.deprecation = true
}
bootJar {
manifest {
attributes(
'Built-By' : System.properties['user.name'],
'Build-Timestamp': new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
'Build-Version' : project.version,
'Build-Commit' : versioning.info.full,
'Created-By' : "Gradle ${gradle.gradleVersion}",
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
)
}
}
task copyTask(type: Copy) {
dependsOn bootJar
from 'deploy'
from 'docs/deployment-readme.txt'
from "${buildDir}/libs"
into 'build/docker'
}
tasks.named('test') {
useJUnitPlatform()
}
import com.bmuschko.gradle.docker.tasks.image.*
task createPlaygroundDockerfile(type: Dockerfile) {
dependsOn copyTask
from 'eclipse-temurin:17-jre'
addFile "private/kubernetes-client-script.py", "/maven/home/deploy/private/kubernetes-client-script.py"
addFile "deployment-readme.txt", "/maven/home/docs/deployment-readme.txt"
addFile "private/orchestrator_client/orchestrator_client.py", "/maven/home/deploy/private/orchestrator_client/orchestrator_client.py"
addFile "private/orchestrator_client/status_client.py", "/maven/home/deploy/private/orchestrator_client/status_client.py"
addFile "private/orchestrator_client/orchestrator_pb2_grpc.py", "/maven/home/deploy/private/orchestrator_client/orchestrator_pb2_grpc.py"
addFile "private/orchestrator_client/orchestrator_pb2.py", "/maven/home/deploy/private/orchestrator_client/orchestrator_pb2.py"
addFile "private/protobuf/orchestrator.proto", "/maven/home/deploy/private/protobuf/orchestrator.proto"
addFile "private/requirements.txt", "/maven/home/deploy/private/requirements.txt"
addFile "${project.name}-${project.version}.jar", "maven/${project.name}-${project.version}.jar"
}
def image_list = []
task createPlaygroundImage(type: DockerBuildImage) {
dependsOn createPlaygroundDockerfile
if(System.properties['docker.push.registry']) {
images.add("${System.properties['docker.push.registry']}/${project.group}/${project.name}:${project.version}")
} else {
images.add("${project.group}/${project.name}:${project.version}")
}
image_list = images
}
task pushPlaygroundImage(type: DockerPushImage) {
dependsOn createPlaygroundImage
images = image_list
registryCredentials {
username = System.properties['docker.username']
password = System.properties['docker.password']
}
}