VM-Operator/org.jdrupes.vmoperator.manager/build.gradle

132 lines
4.2 KiB
Groovy
Raw Normal View History

2023-05-23 21:38:32 +02:00
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
id 'org.jdrupes.vmoperator.java-application-conventions'
}
dependencies {
implementation project(':org.jdrupes.vmoperator.manager.events')
implementation 'commons-cli:commons-cli:1.5.0'
2024-10-04 15:01:58 +00:00
implementation 'org.jgrapes:org.jgrapes.util:[1.38.1,2)'
implementation 'org.jgrapes:org.jgrapes.io:[2.12.1,3)'
2024-08-10 10:41:50 +00:00
implementation 'org.jgrapes:org.jgrapes.http:[3.5.0,4)'
2025-05-03 22:29:42 +02:00
implementation 'org.jgrapes:org.jgrapes.webconsole.base:[2.3.0,3)'
2024-11-15 15:29:19 +01:00
implementation 'org.jgrapes:org.jgrapes.webconsole.vuejs:[1.8.0,2)'
2024-08-10 10:41:50 +00:00
implementation 'org.jgrapes:org.jgrapes.webconsole.rbac:[1.4.0,2)'
implementation 'org.jgrapes:org.jgrapes.webconlet.oidclogin:[1.7.0,2)'
implementation 'org.jgrapes:org.jgrapes.webconlet.markdowndisplay:[1.2.0,2)'
2023-11-01 20:23:03 +01:00
runtimeOnly 'org.jgrapes:org.jgrapes.webconlet.sysinfo:[1.4.0,2)'
runtimeOnly 'org.jgrapes:org.jgrapes.webconlet.logviewer:[0.2.0,2)'
2023-07-22 14:36:42 +02:00
2023-09-01 22:22:57 +02:00
runtimeOnly 'com.electronwill.night-config:yaml:[3.6.7,3.7)'
runtimeOnly 'org.eclipse.angus:angus-activation:[1.0.0,2.0.0)'
2023-07-22 14:36:42 +02:00
runtimeOnly 'org.slf4j:slf4j-jdk14:[2.0.7,3)'
runtimeOnly 'org.apache.logging.log4j:log4j-to-jul:2.20.0'
2024-11-23 14:08:45 +01:00
runtimeOnly project(':org.jdrupes.vmoperator.vmmgmt')
2024-11-23 12:50:25 +01:00
runtimeOnly project(':org.jdrupes.vmoperator.vmaccess')
2023-05-23 21:38:32 +02:00
}
application {
2023-08-09 18:17:46 +02:00
applicationName = 'vm-manager'
applicationDefaultJvmArgs = ['-Xmx128m', '-XX:+UseParallelGC',
2023-08-09 18:17:46 +02:00
'-Djava.util.logging.manager=org.jdrupes.vmoperator.util.LongLoggingManager'
]
2023-05-23 21:38:32 +02:00
// Define the main class for the application.
mainClass = 'org.jdrupes.vmoperator.manager.Manager'
}
2023-08-09 18:17:46 +02:00
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
2024-06-23 12:52:18 +02:00
def registry = "${project.rootProject.properties['docker.registry']}"
def rootVersion = rootProject.version
2023-08-09 18:17:46 +02:00
task buildImage(type: Exec) {
dependsOn installDist
inputs.files 'src/org/jdrupes/vmoperator/manager/Containerfile'
commandLine 'podman', 'build', '--pull',
'-t', "${project.name}:${project.gitBranch}",\
2023-08-09 18:17:46 +02:00
'-f', 'src/org/jdrupes/vmoperator/manager/Containerfile', '.'
}
task pushImage(type: Exec) {
dependsOn buildImage
// Don't push without testing first
dependsOn test
2023-08-09 18:17:46 +02:00
commandLine 'podman', 'push', '--tls-verify=false', \
2024-06-23 12:52:18 +02:00
"${project.name}:${project.gitBranch}", \
"${registry}/${project.name}:${project.gitBranch}"
2023-08-09 18:17:46 +02:00
}
2024-06-23 12:52:18 +02:00
task tagWithVersion(type: Exec) {
dependsOn pushImage
2023-08-09 18:17:46 +02:00
enabled = !rootVersion.contains("SNAPSHOT")
2024-06-23 12:52:18 +02:00
commandLine 'podman', 'push', \
"${project.name}:${project.gitBranch}",\
"${registry}/${project.name}:${project.version}"
}
task tagAsLatest(type: Exec) {
dependsOn tagWithVersion
enabled = !rootVersion.contains("SNAPSHOT")
&& !rootVersion.contains("alpha") \
&& !rootVersion.contains("beta") \
2024-02-17 19:42:44 +01:00
|| project.rootProject.properties['docker.testRegistry'] \
&& project.rootProject.properties['docker.registry'] \
== project.rootProject.properties['docker.testRegistry']
2024-06-23 12:52:18 +02:00
commandLine 'podman', 'push', \
"${project.name}:${project.gitBranch}",\
"${registry}/${project.name}:latest"
2023-08-09 18:17:46 +02:00
}
2024-06-23 12:52:18 +02:00
task publishImage {
dependsOn pushImage
dependsOn tagWithVersion
dependsOn tagAsLatest
}
task pushForTest(type: Exec) {
dependsOn buildImage
commandLine 'podman', 'push', '--tls-verify=false', \
2024-06-23 12:52:18 +02:00
"${project.name}:${project.gitBranch}", \
"${project.rootProject.properties['docker.testRegistry']}" \
+ "/${project.name}:test"
2023-08-09 18:17:46 +02:00
}
2023-08-19 15:22:31 +02:00
test {
enabled = project.hasProperty("k8s.testCluster")
2023-08-19 15:29:59 +02:00
if (enabled) {
2023-08-21 16:55:25 +02:00
dependsOn project.tasks["pushForTest"]
2023-08-19 15:29:59 +02:00
}
2023-08-19 15:22:31 +02:00
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
systemProperty "k8s.testCluster", project.hasProperty("k8s.testCluster")
? project.getProperty("k8s.testCluster") : null
}
// Update favicon:
// # Convert with inkscape to png because convert cannot handle svg
// # background transparency, then
// convert VM-Operator.png -background transparent \
// -define icon:auto-resize=256,64,48,32,16 favicon.ico