The root repository for my Java projects, created between June 2024 and August 2024. It aggregates configurations and functions as shared container volume storage. Each module has its own repository, with unique versions and selective dependency implementation.
This project enables you to maintain multiple Spring applications and seamlessly deploy them on a home server. It works, but all of this is still pretty much in the experimental stage, so don't get too attached.
- Description: This network includes the OpenTelemetry (OTel) collector. Applications send traces, metrics, and logs to it.
- Current Status: Storage, processing, and visualization stack has not been chosen yet, I am considering the Elastic stack.
- Past Solutions: Previously, I used the Grafana, Loki, Tempo, and Prometheus stack. However, creating dashboards manually proved to be too much of an overhead for one person.
- Description: This network includes PostgreSQL.
- Initialization: Contains an
init.sql
file that initializes databases for the modules.
- Description: This network includes Cloudflared and Caddy, allowing applications to be exposed on the internet or local network. Is meant to be used only on the server.
- Future Plans: Develop a comprehensive link tree as a default for easier access to container services and observability tools.
- Generates Docker Compose files for observability and data from template files and versions.
./gradlew generateBaseCompose
-
Brings up or down Docker services in provided project name (unanimous with network).
-
-Ppname=<dockerProjectName>
: Specifies the compose file to be used.
./gradlew composeUp -Ppname=data
./gradlew composeDown -Ppname=data
- Brings up or down observability and data containers. Networking has to be managed separately.
./gradlew composeBaseUp
./gradlew composeBaseDown
- Runs the Cloudflare tunnel using the
run_tunnel.sh
script. - Remember to check if the tunnel has been registered properly.
./gradlew runTunnel
- Location: gradle/util/docker.gradle.kts
- Creates a docker image of a module (a fat jar).
./gradlew app-template:dockerBuild
- Brings up or down a selected compose network. On the server remember to be on the respective branch (dev for dev spring profile, master for prod spring profile).
./gradlew app-template:moduleProdUp
./gradlew app-template:moduleDevUp
-
Location: gradle/util/git.gradle.kts
-
Each module and the base have a project.version file.
-
These tasks are a wrapper for the Git Flow plugin, which also manages the version.
-
In case of a merge conflict the task will be aborted, and you might have to update the version manually during the merge, or rerun the task again after.
-
Read more about what happens under the hood here: https://github.com/nvie/gitflow/wiki/Command-Line-Arguments
-
While git flow is not recommended in business environments, it works quite well in a solo project. You can focus on selected features, and test a release on a separate branch.
./gradlew featureStart -Pbranch=tempFeature
./gradlew featureFinish -Pbranch=tempFeature
./gradlew releaseStart
./gradlew releaseFinish`
./gradlew hotfixStart -Pbranch=tempFeature
./gradlew hotfixFinish -Pbranch=tempFeature
printVersion - prints the current version of the module as specified in the project.version file