The demo application that can be used to demonstrate on how to do CI with Java Applications with Drone CI. This project plays well with used with Java GitOps Demo with Argo CD.
You need a environment that can help you do CI and GitOps. You can setup one locally as described here https://github.com/kameshsampath/dag-stack.git.
Copy Account settings from Drone,
export DRONE_SERVER=http://drone-127.0.0.1.sslip.io:30980
export DRONE_TOKEN=<some token value>
export REGISTRY_NAME=nexus.infra
# always 18081 for in cluster push and pull
export REGISTRY_PORT=18081
export IMAGE_REGISTRY_USER=admin
export IMAGE_REGISTRY_PASSWORD=admin123
export GITEA_USERNAME=user-01
Ensure the token works,
drone info
IMPORTANT: Activate the quarkus-springboot-demo
project on Drone.
./scripts/add-secrets.sh
./scripts/update-secrets.sh
./scripts/rm-secrets.sh
To test the application with Kubernetes use the https://github.com/kameshsampath/dag-stack, that will rely use GitOps Principles to deploy the application
Start the Database:
docker-compose up
NOTE: For local run, update the src/main/resources/applicaiton.properties to make sure the Postgesql url is jdbc:postgresql://localhost:5432/demodb
mvn clean package
java -jar target/fruits-app.jar
Checkout to quarkus branch:
git checkout db-quarkus
mvn clean package
java -jar target/quarkus-app/quarkus-run.jar
mvn package -Pnative
./target/fruits-app
docker-compose up -d
Now open the url http://localhost:8080/api/all to see the list of fruits.
Test adding a fruit:
http localhost:8080/api/add name=jackfruit season=summer
You can check the list of fruits again using http://localhost:8080/api/all. .