further improve release steps 6 and 9

Originally I thought I was causing issues by running `./gradlew clean` separate from `./gradlew srcDistTar binaryDistTar`. If I did (or so I thought), a `fineract-provider/build/classes/java/main/git.properties` file was _sometimes_ not generated (the `generateGitProperties` task failing, misbehaving, or not even running? was the file getting deleted? no idea).

Unsure of the cause, at least I understand that file is supposed to end up at `BOOT-INF/classes/git.properties` in `fineract-provider-VERSION.jar` in the binary release tarball. Its contents are displayed at the `/fineract-provider/actuator/info` endpoint. I think that's more or less how it works, but I did not spend enough time on this to be certain.

Now I think it wasn't at all related to how I was running our Gradle tasks, but rather some nasty behavior in gradle-git-properties:

* https://github.com/n0mer/gradle-git-properties/issues/233
* https://github.com/gradle/gradle/issues/34177

Yuck. 🤢
This commit is contained in:
Adam Monsen
2025-10-11 17:17:03 -07:00
parent 6052ae60b4
commit cce46de767
2 changed files with 29 additions and 20 deletions
@@ -6,10 +6,11 @@ Create source and binary tarballs.
[source,bash,subs="attributes+"] [source,bash,subs="attributes+"]
---- ----
./gradlew clean ./gradlew clean srcDistTar binaryDistTar
./gradlew srcDistTar binaryDistTar
---- ----
Check that `fineract-provider/build/classes/java/main/git.properties` exists. If so, continue. If not, you're likely encountering https://github.com/n0mer/gradle-git-properties/issues/233[this bug], and you need to re-run the command above to create proper source and binary tarballs. That `git.properties` file is supposed to end up at `BOOT-INF/classes/git.properties` in `fineract-provider-{revnumber}.jar` in the binary release tarball. Its contents are displayed at the `/fineract-provider/actuator/info` endpoint. It may be possible to fix this heisenbug entirely by https://github.com/gradle/gradle/issues/34177#issuecomment-3051970053[modifying our git properties gradle plugin config] in `fineract-provider/build.gradle`, perhaps by changing where `git.properties` is written.
Look in `fineract-war/build/distributions/` for the tarballs. Look in `fineract-war/build/distributions/` for the tarballs.
Do some sanity checks. The source tarball and the code in the release branch (at the commit with the release tag) should match. Do some sanity checks. The source tarball and the code in the release branch (at the commit with the release tag) should match.
@@ -25,17 +26,10 @@ cd ..
diff -r fineract apache-fineract-src-{revnumber} diff -r fineract apache-fineract-src-{revnumber}
---- ----
Make sure the code compiles and tests pass on the uncompressed source. Do as much testing as you can and share what you did. Here's the bare minimum check: Make sure the code compiles and tests pass on the uncompressed source. You should at the very least do exactly what you will ask the community to do in <<Step 9: Verify Distribution Staging>>.
[source,bash,subs="attributes+"]
----
./gradlew build -x test -x doc
----
Ideally you'd build code and docs and run every possible test and check, but https://github.com/apache/fineract/actions[running everything has complex dependencies, caches, and takes many hours]. It is rarely done in practice offline / local / on developer machines. But please, go ahead and run the test and doc tasks, and more! Grab a cup of coffee and run everything you can. See the various builds in `.github/workflows/` and try the same things on your own. We should all hammer on a release candidate as much as we can to see if it breaks and fix it if so. All that of course improves our final release. Ideally you'd build code and docs and run every possible test and check, but https://github.com/apache/fineract/actions[running everything has complex dependencies, caches, and takes many hours]. It is rarely done in practice offline / local / on developer machines. But please, go ahead and run the test and doc tasks, and more! Grab a cup of coffee and run everything you can. See the various builds in `.github/workflows/` and try the same things on your own. We should all hammer on a release candidate as much as we can to see if it breaks and fix it if so. All that of course improves our final release.
Finally, inspect `apache-fineract-bin-{revnumber}.tar.gz`. Make sure the `fineract-provider-{revnumber}.jar` can be run directly, and the `fineract-provider.war` can be run with Tomcat.
NOTE: We don't release any artifacts to Apache's Maven repository. NOTE: We don't release any artifacts to Apache's Maven repository.
== Gradle Task == Gradle Task
@@ -21,8 +21,7 @@ Make sure release artifacts are hosted at https://dist.apache.org/repos/dist/dev
---- ----
# source tarball signature and checksum verification steps # source tarball signature and checksum verification steps
# we'll check the source tarball first # we'll check the source tarball first
version={revnumber} src=apache-fineract-src-{revnumber}.tar.gz
src=apache-fineract-src-$version.tar.gz
# upon success: prints "Good signature" and returns successful exit code # upon success: prints "Good signature" and returns successful exit code
# upon failure: prints "BAD signature" and returns error exit code # upon failure: prints "BAD signature" and returns error exit code
@@ -33,7 +32,7 @@ gpg --verify $src.asc
gpg --print-md SHA512 $src | diff - $src.sha512 gpg --print-md SHA512 $src | diff - $src.sha512
# binary tarball signature and checksum verification steps and outputs are similar # binary tarball signature and checksum verification steps and outputs are similar
bin=apache-fineract-bin-$version.tar.gz bin=apache-fineract-bin-{revnumber}.tar.gz
gpg --verify $bin.asc gpg --verify $bin.asc
gpg --print-md SHA512 $bin | diff - $bin.sha512 gpg --print-md SHA512 $bin | diff - $bin.sha512
---- ----
@@ -48,28 +47,44 @@ TIP: Consider also https://en.wikipedia.org/wiki/Key_signing_party[signing] and
=== Build from source === Build from source
[source,bash] [source,bash,subs="attributes+"]
---- ----
tar -xzf $src tar -xzf $src
cd apache-fineract-src-$version cd apache-fineract-src-{revnumber}
gradle build -x test -x doc ./gradlew build -x test -x doc
cd .. cd ..
---- ----
=== Run from binary === Run from binary
Before running this you must first start a database server and ensure the `fineract_default` and `fineract_tenant` databases exist. Then: Before running Fineract you must first start a <<Database support,supported relational database server>> and ensure the `fineract_default` and `fineract_tenants` databases exist. Detailed steps for database preparation are left as an exercise for the reader. You can find ideas on how to do prepare your database in the `build-mariadb.yml`, `build-mysql.yml`, and `build-postgresql.yml` files in source control.
[source,bash] Finally, start your Fineract server:
[source,bash,subs="attributes+"]
----
tar -xvzf apache-fineract-bin-{revnumber}
cd apache-fineract-bin-{revnumber}
export FINERACT_SERVER_SSL_ENABLED=false
export FINERACT_SERVER_PORT=8080
export BACKEND_PROTOCOL=http
export BACKEND_PORT=$FINERACT_SERVER_PORT
# assumes reachable, healthy mariadb with default username, password, and port
java -jar fineract-provider-{revnumber}.jar
----
Alternatively, you can run it in Tomcat:
[source,bash,subs="attributes+"]
---- ----
tar -xzf $bin
cd apache-fineract-bin-$version
cat << 'EndOfRcenv' >> rcenv cat << 'EndOfRcenv' >> rcenv
FINERACT_SERVER_SSL_ENABLED=false FINERACT_SERVER_SSL_ENABLED=false
FINERACT_SERVER_PORT=8080 FINERACT_SERVER_PORT=8080
BACKEND_PROTOCOL=http BACKEND_PROTOCOL=http
BACKEND_PORT=$FINERACT_SERVER_PORT BACKEND_PORT=$FINERACT_SERVER_PORT
EndOfRcenv EndOfRcenv
source rcenv
# assumes reachable, healthy mariadb with default username, password, and port
docker run --rm -it -v "$(pwd):/usr/local/tomcat/webapps" \ docker run --rm -it -v "$(pwd):/usr/local/tomcat/webapps" \
--net=host --env-file=rcenv tomcat:jre21 --net=host --env-file=rcenv tomcat:jre21
---- ----