You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by pt...@apache.org on 2022/02/19 09:46:50 UTC
[fineract] branch develop updated: FINERACT-1506: Add WAR artifact to release distribution again
This is an automated email from the ASF dual-hosted git repository.
ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 73723ac FINERACT-1506: Add WAR artifact to release distribution again
73723ac is described below
commit 73723aca66c67710fd1dc01f26fc135e3b7f9d00
Author: Aleksandar Vidakovic <ch...@monkeysintown.com>
AuthorDate: Sat Feb 19 08:14:57 2022 +0100
FINERACT-1506: Add WAR artifact to release distribution again
---
README.md | 18 ++++-----
fineract-provider/build.gradle | 85 +---------------------------------------
fineract-war/build.gradle | 89 ++++++++++++++++++++++++++++++++++++++++++
3 files changed, 99 insertions(+), 93 deletions(-)
diff --git a/README.md b/README.md
index be4a350..767629f 100644
--- a/README.md
+++ b/README.md
@@ -447,7 +447,7 @@ Releasing
Before you use Gradle to create a release you need to make sure that you provide the proper GPG parameters. You have to options:
-1. Provide the parameters via ~/gradle/gradle.properties in your home folder:
+1. Provide the parameters via ~/.gradle/gradle.properties in your home folder:
```
signing.gnupg.keyName=7890ABCD
signing.gnupg.passphrase=secret
@@ -469,23 +469,23 @@ NOTE: Let's assume your GPG key ID would be "ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789
Above tasks will create the following files in folder build/distributions:
-- binary distribution file: apache-fineract-1.4.0-binary.tar.gz
-- ASCII armored signature for binary distribution: apache-fineract-1.4.0-binary.tar.gz.asc
-- SHA512 checksum for binary distribution: apache-fineract-1.4.0-binary.tar.gz.sha512
-- source distribution file: apache-fineract-1.4.0-src.tar.gz
-- ASCII armored signature for source distribution: apache-fineract-1.4.0-src.tar.gz.asc
-- SHA512 checksum for source distribution: apache-fineract-1.4.0-src.tar.gz.sha512
+- binary distribution file: apache-fineract-1.6.0-binary.tar.gz
+- ASCII armored signature for binary distribution: apache-fineract-1.6.0-binary.tar.gz.asc
+- SHA512 checksum for binary distribution: apache-fineract-1.6.0-binary.tar.gz.sha512
+- source distribution file: apache-fineract-1.6.0-src.tar.gz
+- ASCII armored signature for source distribution: apache-fineract-1.6.0-src.tar.gz.asc
+- SHA512 checksum for source distribution: apache-fineract-1.6.0-src.tar.gz.sha512
The signatures are automatically verified by the build script. It will throw an exception if the verification fails.
Additionally, you can verify the validity of the release distribution files e. g. with:
```
-gpg --verify build/distributions/apache-fineract-1.4.0-binary.tar.gz.asc
+gpg --verify build/distributions/apache-fineract-1.6.0-binary.tar.gz.asc
```
The output should look somewhat like this:
```
-gpg: assuming signed data in 'build/distributions/apache-fineract-1.4.0-binary.tgz'
+gpg: assuming signed data in 'build/distributions/apache-fineract-1.6.0-binary.tgz'
gpg: Signature made Mi 26 Aug 2020 17:17:45 CEST
gpg: using RSA key ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890ABCD
gpg: Good signature from "Aleksandar Vidakovic (Apache Fineract Release Manager) <al...@apache.org>" [ultimate]
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index dc60d25..6808759 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -24,8 +24,6 @@ apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'com.gorylenko.gradle-git-properties'
apply plugin: 'io.swagger.core.v3.swagger-gradle-plugin'
-apply plugin: 'distribution'
-apply plugin: 'signing'
apply plugin: 'com.google.cloud.tools.jib'
// Custom OpenJPA enhancement
@@ -268,6 +266,7 @@ jar {
}
jar.dependsOn resolve
+jar.dependsOn bootJar
jib {
from {
@@ -331,88 +330,6 @@ jib {
tasks.jibDockerBuild.dependsOn = ["bootJar"]
-tasks.withType(Tar) {
- compression Compression.GZIP
- extension 'tar.gz'
-}
-
-distributions {
- binary {
- if(project.hasProperty("distVersion")) {
- distributionBaseName = "apache-fineract-$distVersion-binary"
- } else {
- distributionBaseName = "apache-fineract-binary"
- }
- contents {
- from bootJar
- // TODO: @vidakovic add war
- // TODO: @vidakovic add client library
- from("$rootDir/licenses/") {
- into "licenses/"
- }
- from "$rootDir/LICENSE_RELEASE"
- from "$rootDir/NOTICE_RELEASE"
- rename ('LICENSE_RELEASE', 'LICENSE')
- rename ('NOTICE_RELEASE', 'NOTICE')
-
- from "$rootDir/DISCLAIMER"
- from "$rootDir/README.md"
- }
- }
- src {
- if(project.hasProperty("distVersion")) {
- distributionBaseName = "apache-fineract-$distVersion-src"
- } else {
- distributionBaseName = "apache-fineract-src"
- }
-
- contents {
- 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', '**/gradle', '**/.gitkeep'
- rename ('LICENSE_SOURCE', 'LICENSE')
- rename ('NOTICE_SOURCE', 'NOTICE')
- }
- }
-}
-
-tasks.binaryDistZip.enabled false
-tasks.srcDistZip.enabled false
-tasks.binaryDistTar.dependsOn bootJar
-tasks.srcDistTar.dependsOn prepareInputYaml
-
-// create signatures and checksums only if project parameter "fineract.release" is provided on the command line
-if( project.hasProperty("fineract.release") ) {
- signing {
- useGpgCmd()
- sign (binaryDistTar, srcDistTar)
- }
- tasks.withType(Tar) { task ->
- task.doLast {
- ant.checksum file: task.archivePath, algorithm: 'SHA-512', fileext: '.sha512'
- }
- }
- tasks.withType(Sign) { task ->
- task.doLast {
- task.getFilesToSign().each { f ->
- new ByteArrayOutputStream().withStream { os ->
- def result = exec {
- workingDir "$buildDir/distributions"
- executable 'sh'
- args '-c', "gpg --verify ${f}.asc"
- standardOutput = os
- }
- if(result.exitValue==0) {
- println '+++ GPG signature correct!'
- } else {
- println '--- GPG signature incorrect!'
- throw new RuntimeException('--- GPG signature incorrect!')
- }
- }
- }
- }
- }
-}
-
// Configuration for git properties gradle plugin
// https://github.com/n0mer/gradle-git-properties
gitProperties {
diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle
index e45cbb5..cfb6e3e 100644
--- a/fineract-war/build.gradle
+++ b/fineract-war/build.gradle
@@ -19,6 +19,8 @@
description = 'Fineract WAR'
apply plugin: 'war'
+apply plugin: 'distribution'
+apply plugin: 'signing'
war {
archiveFileName = 'fineract-provider.war'
@@ -48,3 +50,90 @@ war {
dependencies {
implementation project(':fineract-provider')
}
+
+tasks.withType(Tar) {
+ compression Compression.GZIP
+ extension 'tar.gz'
+}
+
+distributions {
+ binary {
+ if(project.hasProperty("distVersion")) {
+ distributionBaseName = "apache-fineract-$distVersion-binary"
+ } else {
+ distributionBaseName = "apache-fineract-binary"
+ }
+ contents {
+ from ("$rootDir/fineract-client/build/libs/") {
+ include 'fineract-client-*.jar'
+ }
+ from ("$rootDir/fineract-provider/build/libs/") {
+ include 'fineract-provider-*.jar'
+ exclude 'fineract-provider-*-plain.jar'
+ }
+ from war
+ from("$rootDir/licenses/") {
+ into "licenses/"
+ }
+ from "$rootDir/LICENSE_RELEASE"
+ from "$rootDir/NOTICE_RELEASE"
+ rename ('LICENSE_RELEASE', 'LICENSE')
+ rename ('NOTICE_RELEASE', 'NOTICE')
+
+ from "$rootDir/DISCLAIMER"
+ from "$rootDir/README.md"
+ }
+ }
+ src {
+ if(project.hasProperty("distVersion")) {
+ distributionBaseName = "apache-fineract-$distVersion-src"
+ } else {
+ distributionBaseName = "apache-fineract-src"
+ }
+
+ contents {
+ 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', '**/gradle', '**/.gitkeep'
+ rename ('LICENSE_SOURCE', 'LICENSE')
+ rename ('NOTICE_SOURCE', 'NOTICE')
+ }
+ }
+}
+
+tasks.binaryDistZip.enabled false
+tasks.srcDistZip.enabled false
+tasks.binaryDistTar.dependsOn war
+// tasks.srcDistTar.dependsOn prepareInputYaml
+
+// create signatures and checksums only if project parameter "fineract.release" is provided on the command line
+if( project.hasProperty("fineract.release") ) {
+ signing {
+ useGpgCmd()
+ sign (binaryDistTar, srcDistTar)
+ }
+ tasks.withType(Tar) { task ->
+ task.doLast {
+ ant.checksum file: task.archivePath, algorithm: 'SHA-512', fileext: '.sha512'
+ }
+ }
+ tasks.withType(Sign) { task ->
+ task.doLast {
+ task.getFilesToSign().each { f ->
+ new ByteArrayOutputStream().withStream { os ->
+ def result = exec {
+ workingDir "$buildDir/distributions"
+ executable 'sh'
+ args '-c', "gpg --verify ${f}.asc"
+ standardOutput = os
+ }
+ if(result.exitValue==0) {
+ println '+++ GPG signature correct!'
+ } else {
+ println '--- GPG signature incorrect!'
+ throw new RuntimeException('--- GPG signature incorrect!')
+ }
+ }
+ }
+ }
+ }
+}