Skip to content
Snippets Groups Projects
Commit 718f28a5 authored by Nicholas Blair's avatar Nicholas Blair
Browse files

feat: add artifact-version.groovy expected by Jenkins build

parent 965b82ff
No related branches found
No related tags found
1 merge request!2feat: always populate MANIFEST with project.name and .version
// Script executed by Jenkins build
// Get project version version and assign to ARTIFACT_VERSION parameter
import hudson.model.*
import java.util.jar.*
def build = Thread.currentThread().executable
Manifest manifest = new Manifest(
new FileInputStream(
new File("${build.workspace}/build/tmp/jar/MANIFEST.MF")));
def version = manifest.getAttributes().getValue(Attributes.Name.IMPLEMENTATION_VERSION)
println "Artifact version is $version"
build.addAction(
new ParametersAction([
new StringParameterValue("ARTIFACT_VERSION", version),
])
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment