Sample illustration of JAVA application with Micronaut and OCI Devops
- Create OCI Devops build pipeline.
- Build a Java Micronaut simple sample application.
- Push the artifact to OCI Container repo.
- Use OCI Deployment pipeline and deploy to OCI OKE.
- Create an OCI container registry . https://docs.oracle.com/en-us/iaas/Content/Registry/home.htm
-
Set policies & create a devops project - https://docs.oracle.com/en-us/iaas/Content/devops/using/home.htm.
-
Create an OCI devops build pipeline. https://docs.oracle.com/en-us/iaas/Content/devops/using/create_buildpipeline.htm
-
Create a OCI Connection with GITHUB using the PAT or move the code to OCI code repo. - https://docs.oracle.com/en-us/iaas/Content/devops/using/managing_coderepo.htm
-
We need a code repo to build the managed build stage inside an OCI build pipeline.
-
Add a managed build statge to the build pipeline. -
https://docs.oracle.com/en-us/iaas/Content/devops/using/add_buildstage.htm#add_buildstage
- Create Artifacts - one with the container repo URL and another one for the deployment spec (deployment_spec.yaml). - https://docs.oracle.com/en-us/iaas/Content/devops/using/artifacts.htm
- Add a deliver artifact stage to the OCI deployment using the artifact reference (with OCI container repo). - https://docs.oracle.com/en-us/iaas/Content/devops/using/add_deliverartifact.htm
-
Create an OKE cluster ,or ensure you have one to use for the deployment. https://docs.oracle.com/en-us/iaas/Content/ContEng/home.htm
-
Create an OCI Devops enviroment with OKE cluster. - https://docs.oracle.com/en-us/iaas/Content/devops/using/environments.htm
- Create a OCI deployment pipeline using the OKE cluster enviroment and the artifact (kubernetes manifest) created.
- Ensure to add below deployment parameters for the deployment pipeline.
- Connect the deployment pipeline with build pipeline by adding Invoke deployment stage to the existing OCI build pipeline.
- Final view of our build pipeline is as below .
- Do a test Run.
- Connect to the OKE and fetch the Loadbalancer IP to validate the application .
- Launch a browser and use the URL http://< Loadbalancer IP >/hello
- You can validate the execution via build logs too