This project uses Quarkus, the Supersonic Subatomic Java Framework.
If you want to learn more about Quarkus, please visit its website: https://quarkus.io/ .
You can run your application in dev mode that enables live coding using:
mvn compile quarkus:dev
NOTE: Quarkus now ships with a Dev UI, which is available in dev mode only at http://localhost:8080/dev/.
Checking known OWASP vulnerabilities using:
mvn verify -Dcheckstyle.skip -DskipUTs -DskipPTs -DskipFTs
Verifying dependencies updates using:
mvn versions:display-dependency-updates
Checking plugin updates using:
mvn versions:display-plugin-updates
Verifying checkstyle using:
mvn validate
Run Unit tests using:
mvn test -DskipDCs -Dcheckstyle.skip -DskipFTs -DskipPTs
Run Functional and Integrations using:
mvn verify -DskipDCs -Dcheckstyle.skip -DskipUTs -DskipPTs
You can build a Docker image using:
mvn clean package -Dquarkus.container-image.build=true
It builds a Docker image and tag as `jgaspar/devops-test:1.0.0
This application requires a PostgreSQL database server. Do you need a ready-to-use PostgreSQL server to try out the API?
docker run -d --restart always --name postgres \
-e POSTGRES_DB=devops_test \
-e POSTGRES_USER=devops \
-e POSTGRES_PASSWORD=password \
--network host postgres:10.6
You can then run the application using:
docker run -d --rm --network host jgaspar/devops-test:1.0.0
You can test the API via a user-friendly user interface named Swagger UI. Swagger UI is a great tool permitting to visualize and interact with the API. The UI is automatically generated from the application OpenAPI specification. Once the application is started, you can go to http://localhost:8080/swagger-ui and play with the API.
By adding these dependencies, we enable the generation of Kubernetes manifests each time we perform a build while also enabling the build of a container image using Jib. For example, following the execution of ./mvnw package, you will notice amongst the other files that are created, two files named kubernetes.json and kubernetes.yml in the target/kubernetes/ directory.
The generated manifest can be applied to the cluster from the project root using kubectl:
kubectl apply -f target/kubernetes/kubernetes.yml
This assumes that a .kube/config is available in your user directory that points to the target Kubernetes cluster. In other words the extension will use whatever cluster kubectl uses.