// 1. Define the TAR task explicitly
task buildAnsibleTar(type: Tar) {
archiveFileName = "ansible.tar.gz"
destinationDirectory = file("$buildDir/distributions")
compression = Compression.GZIP
// Include the RPM from the buildRpm task
from(tasks.named('buildRpm'))
// Explicitly include your ansible folder from the project root
from("${projectDir}/ansible") {
into('ansible')
}
}
// 2. Hook it into the lifecycle correctly
tasks.named('buildRpm') {
dependsOn tasks.named('jar')
}
buildAnsibleTar.dependsOn tasks.named('buildRpm')
// Use 'assemble' instead of 'build' to avoid circular dependency
tasks.named('assemble') {
dependsOn buildAnsibleTar
}
// Ensure the publishing step waits for the archive
tasks.named('publish') {
dependsOn buildAnsibleTar
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)