-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
210 lines (185 loc) · 6.01 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
buildscript {
repositories {
mavenCentral()
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.gorylenko.gradle-git-properties:gradle-git-properties:2.4.1"
classpath 'com.netflix.nebula:gradle-ospackage-plugin:8.4.1'
classpath 'de.undercouch:gradle-download-task:5.3.0'
classpath "com.palantir.gradle.docker:gradle-docker:0.32.0"
classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
apply plugin: 'com.palantir.docker'
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: "com.gorylenko.gradle-git-properties"
apply plugin: 'jacoco'
apply plugin: 'base'
apply plugin: 'signing'
apply plugin: 'maven-publish'
apply plugin: 'java-library'
description = "Kubernetes Operator for Kettle"
group = 'net.rossonet'
version = '0.1'
ext {
ossrhPassword = System.getenv('OSSRH_PASSWORD')
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
implementation group: 'io.javaoperatorsdk', name: 'operator-framework', version: '3.0.3'
annotationProcessor "io.javaoperatorsdk:operator-framework:3.0.3"
annotationProcessor 'io.fabric8:crd-generator-apt:5.12.2'
implementation 'org.apache.commons:commons-compress:1.21' // per passaggio file tramite API k8s
implementation 'org.takes:takes:1.24.4'
implementation 'org.slf4j:slf4j-jdk14:1.7.36'
implementation 'javax.validation:validation-api:2.0.1.Final'
// testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testImplementation group: 'com.ginsberg', name: 'junit5-system-exit', version: '1.1.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
}
docker {
name "rossonet/kettle-operator:latest"
dockerfile file('Dockerfile.gradle')
files "$buildDir/libs/kettle-operator-${version}-all.jar"
}
task buildDocker() {
group "Operator Build"
description 'Build Docker image'
buildDocker.dependsOn("shadowJar")
buildDocker.finalizedBy("docker")
}
jar {
manifest {
attributes 'Main-Class': 'net.rossonet.operator.KettleOperator'
}
}
test {
useJUnitPlatform()
}
eclipse {
classpath {
downloadJavadoc = true
downloadSources = true
}
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication){
artifactId = "${project.name}"
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'Kettle Operator k8s'
description = 'Pentaho Kettle Kubernetes Operator'
url = 'https://www.rossonet.net/'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0'
}
}
developers {
developer {
id = 'ar4k'
name = 'Andrea Ambrosini'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/rossonet/kettle-operator.git'
developerConnection = 'scm:git:ssh://github.com:rossonet/kettle-operator.git'
url = 'https://github.com/rossonet/kettle-operator/tree/master'
}
}
}
}
repositories {
maven {
url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
name = "sonatype"
credentials {
username "rossonet"
password "${rootProject.ext.ossrhPassword}"
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
gitProperties {
failOnNoGitDirectory = false
customProperty 'component', "${project.name}"
customProperty 'version', "${version}"
dateFormat = "yyyy-MM-dd HH:mm:ssZ"
dateFormatTimeZone = 'GMT'
}
jacocoTestReport {
reports {
xml.enabled true
html.enabled false
}
}
shadowJar {
minimize()
}
javadoc{
destinationDir = file("${rootProject.buildDir}/docs/javadoc/${project.name}/")
failOnError=true
}
task theiaIdeBackend(type: Exec) {
workingDir "./"
commandLine 'docker', 'run', '--init', '--rm', '-p', '3000:3000', '-d', '-v', "${projectDir}:/home/project:cached", 'rossonet/theia-ide:latest'
}
task theiaIdeBackendNoCached(type: Exec) {
workingDir "./"
commandLine 'docker', 'run', '--init', '--rm', '-p', '3000:3000', '-d', '-v', "${projectDir}:/home/project", 'rossonet/theia-ide:latest'
}
task theiaIdeBackendNoVolume(type: Exec) {
workingDir "./"
commandLine 'docker', 'run', '--init', '--rm', '-p', '3000:3000', '-d', '--name', "docker-ide-${project.name}", 'rossonet/theia-ide:latest'
}
task theiaIdeBackendCopy(type: Exec) {
theiaIdeBackendCopy.dependsOn("theiaIdeBackendNoVolume")
workingDir "./"
commandLine 'docker', 'cp', '.', "docker-ide-${project.name}:/home/project/"
}
task theiaIdeBackendStart(type: Exec) {
description 'Run Theia IDE container with docker'
theiaIdeBackendStart.dependsOn("theiaIdeBackendCopy")
group "Theia IDE on Docker Container"
workingDir "./"
commandLine 'docker', 'exec', '-u', 'root', "docker-ide-${project.name}", '/bin/chown', '-R', 'theia:theia', '/home/project'
commandLine 'docker', 'exec', '-u', 'root', "docker-ide-${project.name}", '/bin/chown', '-R', 'theia:theia', '/home/theia'
doLast { println "\n\n*** You can find the Theia IDE at http://localhost:3000 ***" }
doLast { println "To shutdown the IDE:\ndocker stop docker-ide-${project.name}\n- save your work on repository before!\n\n" }
}
task printTheiaIdeBackendDockerCommand(type: Exec) {
workingDir "./"
commandLine 'echo', 'docker', 'run', '--init', '-p', '3000:3000', '-d', '--name', "docker-ide-${project.name}", 'rossonet/theia-ide:latest'
}
task theiaIdeLocalBrowser(type: Exec) {
group "Theia IDE on Docker Container"
description 'Open browser to local Theia IDE'
workingDir "./"
commandLine 'xdg-open', 'http://localhost:3000'
}