Skip to content

Commit cce46de

Browse files
committed
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: * n0mer/gradle-git-properties#233 * gradle/gradle#34177 Yuck. 🤢
1 parent 6052ae6 commit cce46de

2 files changed

Lines changed: 29 additions & 20 deletions

File tree

fineract-doc/src/docs/en/chapters/release/process-step06.adoc

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ Create source and binary tarballs.
66

77
[source,bash,subs="attributes+"]
88
----
9-
./gradlew clean
10-
./gradlew srcDistTar binaryDistTar
9+
./gradlew clean srcDistTar binaryDistTar
1110
----
1211

12+
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.
13+
1314
Look in `fineract-war/build/distributions/` for the tarballs.
1415

1516
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 ..
2526
diff -r fineract apache-fineract-src-{revnumber}
2627
----
2728

28-
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:
29-
30-
[source,bash,subs="attributes+"]
31-
----
32-
./gradlew build -x test -x doc
33-
----
29+
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>>.
3430

3531
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.
3632

37-
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.
38-
3933
NOTE: We don't release any artifacts to Apache's Maven repository.
4034

4135
== Gradle Task

fineract-doc/src/docs/en/chapters/release/process-step09.adoc

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ Make sure release artifacts are hosted at https://dist.apache.org/repos/dist/dev
2121
----
2222
# source tarball signature and checksum verification steps
2323
# we'll check the source tarball first
24-
version={revnumber}
25-
src=apache-fineract-src-$version.tar.gz
24+
src=apache-fineract-src-{revnumber}.tar.gz
2625
2726
# upon success: prints "Good signature" and returns successful exit code
2827
# upon failure: prints "BAD signature" and returns error exit code
@@ -33,7 +32,7 @@ gpg --verify $src.asc
3332
gpg --print-md SHA512 $src | diff - $src.sha512
3433
3534
# binary tarball signature and checksum verification steps and outputs are similar
36-
bin=apache-fineract-bin-$version.tar.gz
35+
bin=apache-fineract-bin-{revnumber}.tar.gz
3736
gpg --verify $bin.asc
3837
gpg --print-md SHA512 $bin | diff - $bin.sha512
3938
----
@@ -48,28 +47,44 @@ TIP: Consider also https://en.wikipedia.org/wiki/Key_signing_party[signing] and
4847

4948
=== Build from source
5049

51-
[source,bash]
50+
[source,bash,subs="attributes+"]
5251
----
5352
tar -xzf $src
54-
cd apache-fineract-src-$version
55-
gradle build -x test -x doc
53+
cd apache-fineract-src-{revnumber}
54+
./gradlew build -x test -x doc
5655
cd ..
5756
----
5857

5958
=== Run from binary
6059

61-
Before running this you must first start a database server and ensure the `fineract_default` and `fineract_tenant` databases exist. Then:
60+
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.
61+
62+
Finally, start your Fineract server:
63+
64+
[source,bash,subs="attributes+"]
65+
----
66+
tar -xvzf apache-fineract-bin-{revnumber}
67+
cd apache-fineract-bin-{revnumber}
68+
export FINERACT_SERVER_SSL_ENABLED=false
69+
export FINERACT_SERVER_PORT=8080
70+
export BACKEND_PROTOCOL=http
71+
export BACKEND_PORT=$FINERACT_SERVER_PORT
72+
# assumes reachable, healthy mariadb with default username, password, and port
73+
java -jar fineract-provider-{revnumber}.jar
74+
----
75+
76+
Alternatively, you can run it in Tomcat:
6277

63-
[source,bash]
78+
[source,bash,subs="attributes+"]
6479
----
65-
tar -xzf $bin
66-
cd apache-fineract-bin-$version
6780
cat << 'EndOfRcenv' >> rcenv
6881
FINERACT_SERVER_SSL_ENABLED=false
6982
FINERACT_SERVER_PORT=8080
7083
BACKEND_PROTOCOL=http
7184
BACKEND_PORT=$FINERACT_SERVER_PORT
7285
EndOfRcenv
86+
source rcenv
87+
# assumes reachable, healthy mariadb with default username, password, and port
7388
docker run --rm -it -v "$(pwd):/usr/local/tomcat/webapps" \
7489
--net=host --env-file=rcenv tomcat:jre21
7590
----

0 commit comments

Comments
 (0)