Add tasks for container publishing.
This commit is contained in:
parent
a79ef7788b
commit
2f6a774139
2 changed files with 65 additions and 7 deletions
|
|
@ -32,12 +32,46 @@ application {
|
|||
mainClass = 'org.jdrupes.vmoperator.runner.qemu.Runner'
|
||||
}
|
||||
|
||||
distributions {
|
||||
main {
|
||||
//distributionBaseName = 'runner-qemu'
|
||||
// contents {
|
||||
// from 'src/readme'
|
||||
// }
|
||||
}
|
||||
task buildArchContainer(type: Exec) {
|
||||
dependsOn installDist
|
||||
inputs.files 'src/org/jdrupes/vmoperator/runner/qemu/Containerfile.arch'
|
||||
|
||||
commandLine 'podman', 'build', '-t', "${project.name}:${project.version}",\
|
||||
'-f', 'src/org/jdrupes/vmoperator/runner/qemu/Containerfile.arch', '.'
|
||||
}
|
||||
|
||||
task tagArchContainer(type: Exec) {
|
||||
dependsOn buildArchContainer
|
||||
|
||||
commandLine 'podman', 'tag', "${project.name}:${project.version}",\
|
||||
"${project.name}:latest"
|
||||
}
|
||||
|
||||
task buildContainer {
|
||||
dependsOn buildArchContainer
|
||||
dependsOn tagArchContainer
|
||||
}
|
||||
|
||||
task pushArchContainer(type: Exec) {
|
||||
dependsOn buildContainer
|
||||
|
||||
commandLine 'podman', 'push', '--tls-verify=false', \
|
||||
"localhost/${project.name}:${project.version}", \
|
||||
"${project.rootProject.properties['docker.registry']}" \
|
||||
+ "/vmoperator/${project.name}:${project.version}"
|
||||
}
|
||||
|
||||
task pushArchContainerAsLatest(type: Exec) {
|
||||
dependsOn buildContainer
|
||||
|
||||
commandLine 'podman', 'push', '--tls-verify=false', \
|
||||
"localhost/${project.name}:${project.version}", \
|
||||
"${project.rootProject.properties['docker.registry']}" \
|
||||
+ "/vmoperator/${project.name}:latest"
|
||||
}
|
||||
|
||||
task pushContainer {
|
||||
dependsOn pushArchContainer
|
||||
dependsOn pushArchContainerAsLatest
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue