Last minute release plugin fixes
This commit is contained in:
@@ -111,7 +111,9 @@ fineract {
|
|||||||
templateFile: "${projectDir}/buildSrc/src/main/resources/jira/changelog.txt.ftl"
|
templateFile: "${projectDir}/buildSrc/src/main/resources/jira/changelog.txt.ftl"
|
||||||
],
|
],
|
||||||
gpg: [
|
gpg: [
|
||||||
file: "${projectDir}/buildSrc/build/libs/buildSrc.jar"
|
files: [
|
||||||
|
"${projectDir}/buildSrc/build/libs/buildSrc.jar"
|
||||||
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
step1: [
|
step1: [
|
||||||
@@ -173,7 +175,10 @@ fineract {
|
|||||||
order: 7,
|
order: 7,
|
||||||
description: 'Sign the distribution artifacts',
|
description: 'Sign the distribution artifacts',
|
||||||
gpg: [
|
gpg: [
|
||||||
file: "${rootDir}/fineract-war/build/distributions/apache-fineract-binary-${project.version}.tar.gz"
|
files: [
|
||||||
|
"${rootDir}/fineract-war/build/distributions/apache-fineract-${project.version}-src.tar.gz",
|
||||||
|
"${rootDir}/fineract-war/build/distributions/apache-fineract-${project.version}-binary.tar.gz"
|
||||||
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
step8: [
|
step8: [
|
||||||
|
|||||||
@@ -324,7 +324,7 @@ class FineractPlugin implements Plugin<Project> {
|
|||||||
|
|
||||||
// step 6
|
// step 6
|
||||||
project.tasks.register("fineractReleaseStep6") {
|
project.tasks.register("fineractReleaseStep6") {
|
||||||
dependsOn(":fineract-war:binaryDistTar")
|
dependsOn(":fineract-war:distTar")
|
||||||
}
|
}
|
||||||
|
|
||||||
// step 7
|
// step 7
|
||||||
@@ -334,13 +334,11 @@ class FineractPlugin implements Plugin<Project> {
|
|||||||
|
|
||||||
gpgService.sign(step.gpg)
|
gpgService.sign(step.gpg)
|
||||||
|
|
||||||
def md5 = gpgService.md5(step.gpg)
|
step.gpg.files.findAll {
|
||||||
def md5File = new File("${step.gpg.file}.md5")
|
gpgService.md5(step.gpg)
|
||||||
md5File.write md5
|
|
||||||
|
|
||||||
def sha512 = gpgService.sha512(step.gpg)
|
gpgService.sha512(step.gpg)
|
||||||
def sha512File = new File("${step.gpg.file}.sha512")
|
}
|
||||||
sha512File.write sha512
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,6 @@ class FineractPluginExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static class FineractPluginGpgParams {
|
static class FineractPluginGpgParams {
|
||||||
String file
|
List<String> files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,11 +92,13 @@ class GpgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void sign(FineractPluginExtension.FineractPluginGpgParams params) {
|
void sign(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||||
InputStream is = new FileInputStream(params.file)
|
params.files.findAll {
|
||||||
|
InputStream is = new FileInputStream(it)
|
||||||
|
|
||||||
BCPGOutputStream os = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(params.file + ".asc")))
|
BCPGOutputStream os = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(it + ".asc")))
|
||||||
sign(is).encode(os)
|
sign(is).encode(os)
|
||||||
os.close();
|
os.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PGPSignature sign(InputStream is) throws IOException, PGPException, GeneralSecurityException {
|
PGPSignature sign(InputStream is) throws IOException, PGPException, GeneralSecurityException {
|
||||||
@@ -115,12 +117,20 @@ class GpgService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String md5(FineractPluginExtension.FineractPluginGpgParams params) {
|
void md5(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||||
return calc(new FileInputStream(params.file), MessageDigest.getInstance("MD5", BouncyCastleProvider.PROVIDER_NAME))
|
params.files.findAll {
|
||||||
|
def result = calc(new FileInputStream(it), MessageDigest.getInstance("MD5", BouncyCastleProvider.PROVIDER_NAME))
|
||||||
|
def file = new File("${it}.md5")
|
||||||
|
file.write result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String sha512(FineractPluginExtension.FineractPluginGpgParams params) {
|
void sha512(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||||
return calc(new FileInputStream(params.file), MessageDigest.getInstance("SHA-512", BouncyCastleProvider.PROVIDER_NAME))
|
params.files.findAll {
|
||||||
|
def result = calc(new FileInputStream(it), MessageDigest.getInstance("SHA-512", BouncyCastleProvider.PROVIDER_NAME))
|
||||||
|
def file = new File("${it}.sha512")
|
||||||
|
file.write result
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String calc(InputStream is, MessageDigest digest) {
|
private static String calc(InputStream is, MessageDigest digest) {
|
||||||
|
|||||||
@@ -58,11 +58,7 @@ tasks.withType(Tar) {
|
|||||||
|
|
||||||
distributions {
|
distributions {
|
||||||
binary {
|
binary {
|
||||||
if(project.hasProperty("distVersion")) {
|
distributionBaseName = 'apache-fineract-binary'
|
||||||
distributionBaseName = "apache-fineract-$distVersion-binary"
|
|
||||||
} else {
|
|
||||||
distributionBaseName = "apache-fineract-binary"
|
|
||||||
}
|
|
||||||
contents {
|
contents {
|
||||||
from ("$rootDir/fineract-client/build/libs/") {
|
from ("$rootDir/fineract-client/build/libs/") {
|
||||||
include 'fineract-client-*.jar'
|
include 'fineract-client-*.jar'
|
||||||
@@ -88,12 +84,7 @@ distributions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
src {
|
src {
|
||||||
if(project.hasProperty("distVersion")) {
|
distributionBaseName = 'apache-fineract-src'
|
||||||
distributionBaseName = "apache-fineract-$distVersion-src"
|
|
||||||
} else {
|
|
||||||
distributionBaseName = "apache-fineract-src"
|
|
||||||
}
|
|
||||||
|
|
||||||
contents {
|
contents {
|
||||||
from "$rootDir/"
|
from "$rootDir/"
|
||||||
exclude '**/build' , '.git', '**/.gradle', '.github', '**/.settings', '**/.project', '**/.classpath', '.idea', 'out', '._.DS_Store', '.DS_Store', 'WebContent', '**/.externalToolbuilders', '.theia', '.gitpod.yml', '.travis.yml', 'LICENSE_RELEASE', 'NOTICE_RELEASE', '**/licenses', '*.class', '**/bin', '*.log', '.dockerignore', '**/.gitkeep'
|
exclude '**/build' , '.git', '**/.gradle', '.github', '**/.settings', '**/.project', '**/.classpath', '.idea', 'out', '._.DS_Store', '.DS_Store', 'WebContent', '**/.externalToolbuilders', '.theia', '.gitpod.yml', '.travis.yml', 'LICENSE_RELEASE', 'NOTICE_RELEASE', '**/licenses', '*.class', '**/bin', '*.log', '.dockerignore', '**/.gitkeep'
|
||||||
@@ -101,6 +92,10 @@ distributions {
|
|||||||
rename ('NOTICE_SOURCE', 'NOTICE')
|
rename ('NOTICE_SOURCE', 'NOTICE')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
doLast {
|
||||||
|
file("${buildDir}/distributions/apache-fineract-binary-${version}.tar.gz").renameTo("${buildDir}/distributions/apache-fineract-${version}-binary.tar.gz")
|
||||||
|
file("${buildDir}/distributions/apache-fineract-src-${version}.tar.gz").renameTo("${buildDir}/distributions/apache-fineract-${version}-src.tar.gz")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
binaryDistZip.enabled false
|
binaryDistZip.enabled false
|
||||||
|
|||||||
Reference in New Issue
Block a user