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"
|
||||
],
|
||||
gpg: [
|
||||
file: "${projectDir}/buildSrc/build/libs/buildSrc.jar"
|
||||
files: [
|
||||
"${projectDir}/buildSrc/build/libs/buildSrc.jar"
|
||||
]
|
||||
]
|
||||
],
|
||||
step1: [
|
||||
@@ -173,7 +175,10 @@ fineract {
|
||||
order: 7,
|
||||
description: 'Sign the distribution artifacts',
|
||||
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: [
|
||||
|
||||
@@ -324,7 +324,7 @@ class FineractPlugin implements Plugin<Project> {
|
||||
|
||||
// step 6
|
||||
project.tasks.register("fineractReleaseStep6") {
|
||||
dependsOn(":fineract-war:binaryDistTar")
|
||||
dependsOn(":fineract-war:distTar")
|
||||
}
|
||||
|
||||
// step 7
|
||||
@@ -334,13 +334,11 @@ class FineractPlugin implements Plugin<Project> {
|
||||
|
||||
gpgService.sign(step.gpg)
|
||||
|
||||
def md5 = gpgService.md5(step.gpg)
|
||||
def md5File = new File("${step.gpg.file}.md5")
|
||||
md5File.write md5
|
||||
step.gpg.files.findAll {
|
||||
gpgService.md5(step.gpg)
|
||||
|
||||
def sha512 = gpgService.sha512(step.gpg)
|
||||
def sha512File = new File("${step.gpg.file}.sha512")
|
||||
sha512File.write sha512
|
||||
gpgService.sha512(step.gpg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,6 +159,6 @@ class FineractPluginExtension {
|
||||
}
|
||||
|
||||
static class FineractPluginGpgParams {
|
||||
String file
|
||||
List<String> files
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,11 +92,13 @@ class GpgService {
|
||||
}
|
||||
|
||||
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")))
|
||||
sign(is).encode(os)
|
||||
os.close();
|
||||
BCPGOutputStream os = new BCPGOutputStream(new ArmoredOutputStream(new FileOutputStream(it + ".asc")))
|
||||
sign(is).encode(os)
|
||||
os.close();
|
||||
}
|
||||
}
|
||||
|
||||
PGPSignature sign(InputStream is) throws IOException, PGPException, GeneralSecurityException {
|
||||
@@ -115,12 +117,20 @@ class GpgService {
|
||||
}
|
||||
|
||||
|
||||
String md5(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||
return calc(new FileInputStream(params.file), MessageDigest.getInstance("MD5", BouncyCastleProvider.PROVIDER_NAME))
|
||||
void md5(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||
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) {
|
||||
return calc(new FileInputStream(params.file), MessageDigest.getInstance("SHA-512", BouncyCastleProvider.PROVIDER_NAME))
|
||||
void sha512(FineractPluginExtension.FineractPluginGpgParams params) {
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user