A Drone pipeline JAR(Java And Reactive) stack to show build, test and deploy a Java API with React Frontend with optional DB.
The stack has the following components,
- A Quarkus based Java REST API with optional persistence using Hibernate
- An React based UI application
-
Docker Desktop for Mac/Windows and Docker on Linux
-
Google Cloud Service Account(SA) with permissions to,
- Ability to deploy to Google Cloud Run
- Ability to push to Google Cloud Registry
-
Optionally gcloud CLI
As the API is not enabled with authentication by default to quickly test the application try allowing allUsers
to access the API,
gcloud run services add-iam-policy-binding fruits-api \
--region="${GCP_REGION}" \
--member="allUsers" \
--role="roles/run.invoker"
To switch back to authentication mode use the following command,
gcloud run services remove-iam-policy-binding fruits-api --member='allUsers' --role='roles/run.invoker' --region="${GCP_REGION}"
Create the secret file
cp secret.example my.secret
Edit the my.secret
and update the value to suit your environment and settings.
drone exec --secret=my.secret .drone.yml
The Drone pipeline command will now start to build the Java Application, push the built application to image registry (Google Container Registry), Deploy the container image as Google Cloud Run service and finally push the UI application Vercel.