Hi,
For purposes of helping our our System Admins, I’m attempting to upload the distribution we build (a tgz) to our repository. I’m wondering how I might configure a suitable task to do this? I’ve attempted to use “artifacts” but that seemed to be unsuccessful:
task distribution(type: Tar, dependsOn: preDistribution) {
ext {
gitVersion = "git rev-parse --verify --short HEAD".execute().text.trim()
}
baseName = 'fubar-' + new Date().format('yyyyMMdd') + '-' + gitVersion
description = "Builds the final distribution archive '${baseName}-${version}.tgz' that is suitable for systems deployment."
destinationDir = new File("${project.buildDir}/dist")
compression = Compression.GZIP
from "${project.buildDir}/dist/tmp"
doLast {
delete "${project.buildDir}/dist/tmp"
}
}
I don’t think Tar (task) has the concept of destFile, otherwise doing this might have worked:
artifacts {
archives distribution.destFile
}
Similarly using “distribution.archiveName” didn’t appear to work.
Please may I have some assistance on this? Thank you.