Version tag may only be applied when all projects are "clean".
This commit is contained in:
parent
b74de67c6d
commit
e3da87d94f
4 changed files with 21 additions and 17 deletions
|
|
@ -7,7 +7,8 @@ buildscript {
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.ajoberstar.grgit' version '5.2.0' apply false
|
id 'org.ajoberstar.grgit' version '5.2.0' apply false
|
||||||
id 'org.ajoberstar.git-publish' version '4.2.0' apply false
|
id 'org.ajoberstar.git-publish' version '4.2.0' apply false
|
||||||
id 'pl.allegro.tech.build.axion-release' version '1.15.0' apply false
|
id 'pl.allegro.tech.build.axion-release' version '1.17.2' apply false
|
||||||
|
id 'org.jdrupes.vmoperator.versioning-conventions'
|
||||||
id 'org.jdrupes.vmoperator.java-doc-conventions'
|
id 'org.jdrupes.vmoperator.java-doc-conventions'
|
||||||
id 'eclipse'
|
id 'eclipse'
|
||||||
id "com.github.node-gradle.node" version "7.0.1"
|
id "com.github.node-gradle.node" version "7.0.1"
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ application {
|
||||||
|
|
||||||
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
||||||
def registry = "${project.rootProject.properties['docker.registry']}"
|
def registry = "${project.rootProject.properties['docker.registry']}"
|
||||||
|
def rootVersion = rootProject.version
|
||||||
|
|
||||||
task buildImage(type: Exec) {
|
task buildImage(type: Exec) {
|
||||||
dependsOn installDist
|
dependsOn installDist
|
||||||
|
|
@ -70,7 +71,7 @@ task pushImage(type: Exec) {
|
||||||
task tagWithVersion(type: Exec) {
|
task tagWithVersion(type: Exec) {
|
||||||
dependsOn pushImage
|
dependsOn pushImage
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
|
|
||||||
commandLine 'podman', 'push', \
|
commandLine 'podman', 'push', \
|
||||||
"${project.name}:${project.gitBranch}",\
|
"${project.name}:${project.gitBranch}",\
|
||||||
|
|
@ -80,9 +81,9 @@ task tagWithVersion(type: Exec) {
|
||||||
task tagAsLatest(type: Exec) {
|
task tagAsLatest(type: Exec) {
|
||||||
dependsOn tagWithVersion
|
dependsOn tagWithVersion
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
&& !project.version.contains("alpha") \
|
&& !rootVersion.contains("alpha") \
|
||||||
&& !project.version.contains("beta") \
|
&& !rootVersion.contains("beta") \
|
||||||
|| project.rootProject.properties['docker.testRegistry'] \
|
|| project.rootProject.properties['docker.testRegistry'] \
|
||||||
&& project.rootProject.properties['docker.registry'] \
|
&& project.rootProject.properties['docker.registry'] \
|
||||||
== project.rootProject.properties['docker.testRegistry']
|
== project.rootProject.properties['docker.testRegistry']
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ application {
|
||||||
|
|
||||||
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
||||||
def registry = "${project.rootProject.properties['docker.registry']}"
|
def registry = "${project.rootProject.properties['docker.registry']}"
|
||||||
|
def rootVersion = rootProject.version
|
||||||
|
|
||||||
task buildImageArch(type: Exec) {
|
task buildImageArch(type: Exec) {
|
||||||
dependsOn installDist
|
dependsOn installDist
|
||||||
|
|
@ -54,7 +55,7 @@ task pushImageArch(type: Exec) {
|
||||||
task tagWithVersionArch(type: Exec) {
|
task tagWithVersionArch(type: Exec) {
|
||||||
dependsOn pushImageArch
|
dependsOn pushImageArch
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
|
|
||||||
commandLine 'podman', 'push', \
|
commandLine 'podman', 'push', \
|
||||||
"${project.name}-arch:${project.gitBranch}",\
|
"${project.name}-arch:${project.gitBranch}",\
|
||||||
|
|
@ -64,9 +65,9 @@ task tagWithVersionArch(type: Exec) {
|
||||||
task tagAsLatestArch(type: Exec) {
|
task tagAsLatestArch(type: Exec) {
|
||||||
dependsOn tagWithVersionArch
|
dependsOn tagWithVersionArch
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
&& !project.version.contains("alpha") \
|
&& !rootVersion.contains("alpha") \
|
||||||
&& !project.version.contains("beta") \
|
&& !rootVersion.contains("beta") \
|
||||||
|| project.rootProject.properties['docker.testRegistry'] \
|
|| project.rootProject.properties['docker.testRegistry'] \
|
||||||
&& project.rootProject.properties['docker.registry'] \
|
&& project.rootProject.properties['docker.registry'] \
|
||||||
== project.rootProject.properties['docker.testRegistry']
|
== project.rootProject.properties['docker.testRegistry']
|
||||||
|
|
@ -96,7 +97,7 @@ task pushImageAlpine(type: Exec) {
|
||||||
task tagWithVersionAlpine(type: Exec) {
|
task tagWithVersionAlpine(type: Exec) {
|
||||||
dependsOn pushImageAlpine
|
dependsOn pushImageAlpine
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
|
|
||||||
commandLine 'podman', 'push', \
|
commandLine 'podman', 'push', \
|
||||||
"${project.name}-alpine:${project.gitBranch}",\
|
"${project.name}-alpine:${project.gitBranch}",\
|
||||||
|
|
@ -106,9 +107,9 @@ task tagWithVersionAlpine(type: Exec) {
|
||||||
task tagAsLatestAlpine(type: Exec) {
|
task tagAsLatestAlpine(type: Exec) {
|
||||||
dependsOn tagWithVersionAlpine
|
dependsOn tagWithVersionAlpine
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
&& !project.version.contains("alpha") \
|
&& !rootVersion.contains("alpha") \
|
||||||
&& !project.version.contains("beta") \
|
&& !rootVersion.contains("beta") \
|
||||||
|| project.rootProject.properties['docker.testRegistry'] \
|
|| project.rootProject.properties['docker.testRegistry'] \
|
||||||
&& project.rootProject.properties['docker.registry'] \
|
&& project.rootProject.properties['docker.registry'] \
|
||||||
== project.rootProject.properties['docker.testRegistry']
|
== project.rootProject.properties['docker.testRegistry']
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ dependencies {
|
||||||
|
|
||||||
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
project.ext.gitBranch = grgit.branch.current.name.replace('/', '-')
|
||||||
def registry = "${project.rootProject.properties['docker.registry']}"
|
def registry = "${project.rootProject.properties['docker.registry']}"
|
||||||
|
def rootVersion = rootProject.version
|
||||||
|
|
||||||
task buildImage(type: Exec) {
|
task buildImage(type: Exec) {
|
||||||
inputs.files 'Containerfile'
|
inputs.files 'Containerfile'
|
||||||
|
|
@ -26,7 +27,7 @@ task pushImage(type: Exec) {
|
||||||
task tagWithVersion(type: Exec) {
|
task tagWithVersion(type: Exec) {
|
||||||
dependsOn pushImage
|
dependsOn pushImage
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
|
|
||||||
commandLine 'podman', 'push', \
|
commandLine 'podman', 'push', \
|
||||||
"${project.name}:${project.gitBranch}",\
|
"${project.name}:${project.gitBranch}",\
|
||||||
|
|
@ -36,9 +37,9 @@ task tagWithVersion(type: Exec) {
|
||||||
task tagAsLatest(type: Exec) {
|
task tagAsLatest(type: Exec) {
|
||||||
dependsOn tagWithVersion
|
dependsOn tagWithVersion
|
||||||
|
|
||||||
enabled = !project.version.contains("SNAPSHOT")
|
enabled = !rootVersion.contains("SNAPSHOT")
|
||||||
&& !project.version.contains("alpha") \
|
&& !rootVersion.contains("alpha") \
|
||||||
&& !project.version.contains("beta") \
|
&& !rootVersion.contains("beta") \
|
||||||
|| project.rootProject.properties['docker.testRegistry'] \
|
|| project.rootProject.properties['docker.testRegistry'] \
|
||||||
&& project.rootProject.properties['docker.registry'] \
|
&& project.rootProject.properties['docker.registry'] \
|
||||||
== project.rootProject.properties['docker.testRegistry']
|
== project.rootProject.properties['docker.testRegistry']
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue