To build and run the application in the dev
mode, execute:
mvn clean install quarkus:dev -Ddev
Notes:
install
Maven target when
running quarkus:dev
.-Ddev
property enables dev
Quarkus profile (even for docker images), and uses
a standalone database (h2) and other components to avoid dependencies.-Ddebug
property to connect a debugger.To build a dev
application image, run:
mvn clean install -Ddev -Dquarkus.container-image.build=true
which can be executed using:
docker run -p 8080:8080 {user}/srs-fleet-manager-core:0.1.0-SNAPSHOT
The application depends on an Apicurio Registry Tenant Manager client. This dependency is not published at the moment, so you have to build the Tenant Manager and the dependency as follows:
git clone git@github.com:Apicurio/apicurio-registry.git
cd apicurio-registry
make build-tenant-manager
Now, you can build the Service API:
mvn clean install -Dquarkus.container-image.build=true
The production deployment of the application requires:
core/src/main/resources/application.properties
for which environment variables to use for configuration)2.0.0-SNAPSHOT
)See dist/openshift/README.md
for information about deploying the required components on OpenShift.
docker run -p 5432:5432 -e 'POSTGRES_PASSWORD=postgres' -d postgres
docker run --network host -p 8080:8080 -e 'SERVICE_API_DATASOURCE_URL=jdbc:postgresql://localhost:5432/postgres' {user}/srs-fleet-manager-core:0.1.0-SNAPSHOT
In order to configure security you must configure the following values:
Option | Env. variable |
---|---|
Enable authentication | AUTH_ENABLED |
Authentication server url | KEYCLOAK_URL |
Authentication realm | KEYCLOAK_REALM |
Authentication client | KEYCLOAK_API_CLIENT_ID |
When security is enabled, the application will also expect the following values to be configured to be able to connect to the tenant-manager in a secure manner:
Option | Env. variable |
---|---|
Tenant manager auth server url | TENANT_MANAGER_AUTH_SERVER_URL |
Tenant manager auth realm | TENANT_MANAGER_AUTH_SERVER_REALM |
Tenant manager auth client | TENANT_MANAGER_AUTH_CLIENT_ID |
Tenant manager auth secret | TENANT_MANAGER_AUTH_SECRET |
The following are several commands for working with the Service API
curl -X POST -H "Content-Type: application/json" \
-d '{"tenantManagerUrl":"http://tm1.app.example.com"}' \
http://localhost:8080/api/serviceregistry_mgmt/v1/admin/registryDeployments
curl http://localhost:8080/api/serviceregistry_mgmt/v1/admin/registryDeployments
curl -X POST -H "Content-Type: application/json" \
-d '{}' \
http://localhost:8080/api/serviceregistry_mgmt/v1/registries
curl http://localhost:8080/api/serviceregistry_mgmt/v1/registries
curl http://localhost:8080/api/serviceregistry_mgmt/v1/admin/tasks
Open VSCode on this project, go to demo/demo.didact.md
file and use Ctrl + Shift + V
to open the Didact view.
You need to be logged to an Openshift 4 cluster to run the demo.