Slackbot
04/13/2022, 12:31 PMgrossws
04/13/2022, 1:44 PMnebula.release
(calculates version base on git tags, create new tags etc) with publishing triggered by tag pushed to remote repo.
What I certainly like with this one is versions like `1.2.0-dev.7.uncommitted+quarkus.migration.deadbee`: previous tag was 1.1.x, so incremented minor version by default + -dev
suffix, 7
is number of commits since that tag, uncommitted
for dirty repo state (some uncommitted changes present in worktree), quarkus.migration
produced from feature branch name quarkus-migration
and last token deadbee
is last git commit id.Vampire
04/13/2022, 1:54 PMnet.researchgate.release
plugin. I is much like the Maven release process, and afair also was designed to be similar.
It cannot calculate the version from Git history, but it will un-snapshot on release, increase afterwards, commit, tag, push, ...
But I actually greatly dislike calculating version from Git history, at least if it is the sole source of version, because that always requires the Git repository to do a simple build. You cannot for example build from a source ZIP.grossws
04/13/2022, 2:01 PMVampire
04/13/2022, 2:08 PMRamesh Vangala
04/13/2022, 2:11 PMgrossws
04/13/2022, 2:12 PMRamesh Vangala
04/13/2022, 2:16 PMBranch OPS-14338 does not match one of the included patterns: [master, HEAD, main, (release(-|/))?\d+(\.\d+)?\.x, v?\d+\.\d+\.\d+]I tried with this configuration
nebulaRelease {
Set<String> releaseBranchPatterns = [/master/, /HEAD/, /OPS-14338/, /main/, /(release(-|\/))?\d+(\.\d+)?\.x/, /v?\d+\.\d+\.\d+/] as Set
// addReleaseBranchPattern(releaseBranchPatterns)
}
It didn't work.grossws
04/13/2022, 2:19 PMVampire
04/13/2022, 2:21 PMVampire
04/13/2022, 2:22 PMRamesh Vangala
04/13/2022, 2:22 PMmvn build-helper:parse-version versions:set -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.minorVersion}.\\${parsedVersion.nextIncrementalVersion} versions:commit
This will basically bump of version. I am looking something similar, please let me know if you need any details. I declared version in gradle.properties, earlier it was in pom.xmlVampire
04/13/2022, 2:24 PMRamesh Vangala
04/13/2022, 2:24 PMgrossws
04/13/2022, 2:25 PMaddReleaseBranchPattern
is commented.
@Ramesh Vangala, try plugin that @Vampire suggested. It'll likely fit your current model much better.Ramesh Vangala
04/13/2022, 2:27 PMVampire
04/13/2022, 2:27 PMString
Vampire
04/13/2022, 2:27 PMVampire
04/13/2022, 2:27 PMVampire
04/13/2022, 2:27 PMgrossws
04/13/2022, 2:29 PMVampire
04/13/2022, 2:29 PMnebulaRelease {
releaseBranchPatterns = [/master/, /HEAD/, /OPS-14338/, /main/, /(release(-|\/))?\d+(\.\d+)?\.x/, /v?\d+\.\d+\.\d+/]
}
or
nebulaRelease {
addReleaseBranchPattern(/OPS-14338/)
}
Vampire
04/13/2022, 2:31 PMI'm on kotlin dsl myself but it has it's own drawbacks since ide sometimes becomes crazy with it 'cause some cache not invalidated in timeI'm on Gradle since its pre-1.0 phase. The time I lost through Groovy shenenigans that would have saved by Kotlin DSL for me heavily outweighs the problems you sometimes have with Kotlin DSL. 😄
grossws
04/13/2022, 2:32 PMRamesh Vangala
04/13/2022, 2:33 PMgrossws
04/13/2022, 2:36 PMRamesh Vangala
04/21/2022, 10:27 AMRamesh Vangala
04/21/2022, 12:20 PMVampire
04/21/2022, 12:42 PMgradle-versions
plugin by Ben Manes,
and also extensions that can directly update to those new versions in the TOML file containing the versions.Ramesh Vangala
04/21/2022, 1:07 PMRamesh Vangala
04/21/2022, 1:07 PMVampire
04/21/2022, 1:27 PMRamesh Vangala
04/21/2022, 3:02 PMtask setVersion(newVersionCatalogVersion) {
Properties props = new Properties()
props.load(new File('gradle.properties').newDataInputStream())
props.setProperty('r4eVersionCatalogVersion', newVersionCatalogVersion)
props.store(propsFile.newWriter(), null)
}
I tried with above it is giving error saying newVersionCatalogVersion not found in groovyRamesh Vangala
04/21/2022, 3:02 PMVampire
04/21/2022, 3:05 PMRamesh Vangala
04/21/2022, 3:56 PMRamesh Vangala
04/21/2022, 3:57 PMRamesh Vangala
04/21/2022, 3:57 PMRamesh Vangala
04/21/2022, 3:57 PMVampire
04/21/2022, 5:09 PMRamesh Vangala
04/21/2022, 5:23 PMRamesh Vangala
04/21/2022, 5:24 PMdef debianDistribution = System.getenv("debianDistribution") == null ? "ENV_NOTFOUND" : System.getenv("debianDistribution")
def buildNumber = System.getenv("BUILD_NUMBER") == null ? "NO_BUILDNUM" : System.getenv("BUILD_NUMBER")
println( System.getenv('debianDistribution'))
println(System.getenv('BUILD_NUMBER'))
subprojects {
// apply plugin: "com.gorylenko.gradle-git-properties"
apply plugin: "com.google.cloud.tools.jib"
if (it.name.contains('-thrift')) {
apply plugin: "org.jruyi.thrift"
} else {
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.boot"
apply plugin: "org.sonarqube"
}
jib {
from {
image = baseImage
}
to {
image = "<http://gcr.io/rep-ops/${project.name}:${version}-|gcr.io/rep-ops/${project.name}:${version}->"+debianDistribution+"-"+buildNumber
credHelper = 'gcr'
tags = ['latest', project.version]
}
container {
entrypoint = [
'sh', '-c', '/entrypoint.sh'
]
ports = ['8081', '8080']
environment = [
"SPRING_OUTPUT_ANSI_ENABLED": "ALWAYS",
"MAIN_CLASS" : "test",
"DEBIAN_JAVA_OPTS" : "test"
]
mainClass = "test"
creationTime = "USE_CURRENT_TIMESTAMP"
}
extraDirectories {
paths = "$projectDir/jib"
permissions = [
'/entrypoint.sh': '755'
]
}
allowInsecureRegistries = false
}
}
Vampire
04/21/2022, 5:33 PMsubprojects { ... }
introduces project coupling and is highly discouraged in favor of using convention plugins.
And apply plugin
is legacy way to apply a plugin which should not be used in favor of plugins { ... }
DSL.