CICD experience: Source-2-image and deploy to Oracle WebLogic Server on AKS
Tags: actionshackathon21, azure, javaee
Published: 2021-12-08 01:47:50

### My Workflow
[Azure-Samples/cargotracker-azure#updateCargoTracker.yml](https://github.com/Azure-Samples/cargotracker-azure/blob/main/.github/workflows/updateCargoTracker.yml)

### Submission Category: 
Maintainer Must-Haves

### Yaml File or Link to Code
{% github https://github.com/Azure-Samples/cargotracker-azure %}

### Additional Resources / Info

#### Story behind it
Real world Java EE on Azure requires industrial strength CI/CD. My team and I started building an example illustrating the path of modernizing a traditional Java EE application(WebLogic + PostgreSQL).

We implemented a GitHub Actions workflow that compiles the Eclipse Cargo Tracker application source, builds the Docker image with help from the [WebLogic Kubernetes Operator](https://oracle.github.io/weblogic-kubernetes-operator/) and uploads it an [Azure Container Registry](https://azure.microsoft.com/en-us/services/container-registry/). This image is then deployed to a WebLogic on Azure Kubernetes Service (AKS) environment as part of the CI/CD experience.

This workflow serves as an end-to-end test for an Azure Marketplace offer that lets you easily deploy [WebLogic Server to Azure Kubernetes Service](https://aka.ms/wlsaks). To learn more about this and other offers for Java EE on Azure, please visit < https://aka.ms/wls-aks-contactme >.

#### What’s interesting in our workflow

We leveraged many existing GitHub Actions such as [actions/checkout](https://github.com/actions/checkout), [azure/CLI](https://github.com/Azure/cli) and [azure/login](https://github.com/Azure/login) to build our pipeline. The [built-in support for bash scripts](https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#defaultsrun) provides all the flexibilities we needed to complete it.

Our pipeline contains the following critical steps:
* Build the application.
* Upload the built artifact to an [Azure Storage Account](https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview).
* Build image and upload to [Azure Container Registry](https://azure.microsoft.com/en-us/services/container-registry/).
* Use the [ARM template behind the Azure Marketplace offer](https://github.com/oracle/weblogic-azure/blob/main/weblogic-azure-aks/src/main/bicep/mainTemplate.bicep) to update the cluster with the latest image.
* Verify all pods are updated.
* Verify the application is running at the latest version using [Playwright](https://playwright.dev/).

This pipeline takes many inputs because it requires all the Azure resources are created & configured before running it. We also have another pipeline [Azure-Samples/cargotracker-azure#setupWlsAks.yml](https://github.com/Azure-Samples/cargotracker-azure/blob/main/.github/workflows/setupWlsAks.yml) to setup the required environment, these two pipelines combine together to provide a more complete DevOps experience.

#### A brief introduction to our work
[Oracle WebLogic Server](https://www.oracle.com/java/weblogic/) is a scalable, enterprise-ready Java application server. We are a team from Microsoft that works on bringing the Oracle WebLogic Server experience on Azure which includes:

* **[WebLogic Server on AKS](https://aka.ms/wlsaks)**: The WebLogic Server on AKS offer automates provisioning an AKS cluster, the WebLogic Kubernetes Operator, WLS Docker images and the Azure Container Registry (ACR). The offer also supports configuring load balancing with Azure App Gateway or the Azure Load Balancer, easing database connectivity, publishing metrics to Azure Monitor as well as mounting Azure Files as Kubernetes Persistent Volumes. For more on this offer, please visit < https://aka.ms/wlsaks >.

* **[WebLogic Server on Virtual Machines](https://aka.ms/wlscluster)**: The WebLogic Server on virtual machines offers automate provisioning virtual network, storage, and Linux resources, installing WLS, setting up security with a network security group, easing database connectivity, configuring load-balancing with App Gateway or Oracle HTTP Server, connecting to Azure Active Directory, enabling centralized logging via ELK as well as integrating distributed caching with Oracle Coherence. For more on this offer, please visit < https://aka.ms/wlscluster >.

_If you want to learn more about our offers or work closely on your migration scenarios with us, just go to this [CONTACT ME](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/oracle.oraclelinux-wls-cluster?tab=Overview) page and hit the button! Program managers, architects and engineers will reach back out to you shortly and initiate collaboration!_

#### Reference
[GitHub Actions](https://github.com/features/actions) makes it easy to develop a lightweight but powerful CI/CD experience for your code from GitHub.

[GitHub Actions for Azure](https://github.com/marketplace?query=Azure&type=actions) are developed by Microsoft and designed to be used with Azure.

[Eclipse Cargo Tracker](https://github.com/Azure-Samples/cargotracker-azure) is a project demonstrates how you can develop applications with Jakarta EE using widely adopted architectural best practices like Domain-Driven Design (DDD).

[Playwright](https://playwright.dev/) is built to enable cross-browser web automation. And it can be easily introduced into a Java project using Maven.