Skip to content

The demo application that can be used to demonstrate on how to do CI with Java Applications with Drone CI

License

Notifications You must be signed in to change notification settings

kameshsampath/quarkus-springboot-demo

Repository files navigation

Java CI with Drone

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.

Prerequisites

Setup DAG Stack

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.

Drone Configuration

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.

Add Secrets to Repository

./scripts/add-secrets.sh

Updating Secrets

./scripts/update-secrets.sh

Remove Secrets

./scripts/rm-secrets.sh

Testing with Kubernetes

To test the application with Kubernetes use the https://github.com/kameshsampath/dag-stack, that will rely use GitOps Principles to deploy the application

Testing the application Locally

Run Locally

Start the Database:

docker-compose up 

Spring Boot

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

Quarkus Spring Boot

Checkout to quarkus branch:

git checkout db-quarkus

JVM mode

mvn clean package
java -jar target/quarkus-app/quarkus-run.jar

Native mode

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

About

The demo application that can be used to demonstrate on how to do CI with Java Applications with Drone CI

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published