Before You Begin
This 15-minute tutorial shows you how to deploy two applications and undeploy an application with WebLogic Deploy Tooling (WDT) artifacts using the Jenkins pipeline job.
Background
Oracle WebLogic Server for Oracle Cloud Infrastructure
Container Engine for Kubernetes (OKE) uses the Jenkins pipeline
update domain
job to update the domain
configuration and deploys applications, shared libraries and
resources to the new domain. In the update domain
job, you specify the location of the WDT archive zip file,
domain model Yaml and variables properties file using File
Upload, Object Storage, or the Shared File System, and build the
job.
This tutorial uses the update domain
job to
deploy two applications simpleear1
and simpleear2
using the WDT archive zip file that contains the model Yaml
file, and then uses the update domain
job to
undeploy the simpleear2
application.
Note: If the UI parameters are not rendered
when you run the update domain
job, approve the
scripts. See Approve Scripts.
What Do You Need?
- An Oracle WebLogic Server for OKE stack created using Resource Manager
- An application
ear
orwar
file - A
model.yaml
file created using the WDT template
The following example shows
the model.yaml
file that uses WDT template
to deploy ear
files. In this model.yaml
file, replace simpleear1.ear
and simpleear2.ear
(ear files) with your application archive file name
and the my-cluster
(target file) with the name
of your cluster.
appDeployments: Application: simpleear1 : SourcePath: wlsdeploy/applications/simpleear1.ear Target: 'my-cluster' ModuleType: ear
simpleear2 :
SourcePath: wlsdeploy/applications/simpleear2.ear
Target: 'my-cluster'
ModuleType: ear
To deploy a war
file,
change the module type to ModuleType: war
in the
model.yaml
file, and for jar
file,
change the module type to ModuleType: jar
in the
model.yaml
file.
Deploy the Applications
To deploy the applications, use the
following model.yaml
file:
appDeployments: Application: simpleear1 : SourcePath: wlsdeploy/applications/simpleear1.ear Target: 'my-cluster' ModuleType: ear
simpleear2 :
SourcePath: wlsdeploy/applications/simpleear2.ear
Target: 'my-cluster'
ModuleType: ear
- From your computer, run the SSH command to connect to the
stack's Administration Server as the
opc
user. - Go to
/u01/shared
location and run the following commands to create an archive.zip with WDTmodel.yaml
.
mkdir -p wlsdeploy/applications
mv your-app.ear wlsdeploy/applications
mv your-app1.ear wlsdeploy/applications
# Forear
file, useyour-app.ear and
forjar
file, useyour-app.jar
.
mkdir -p model mv path_to_your_model.yaml/your-model.yaml model/model.yaml zip -r archive.zip wlsdeploy/applications/ model/model.yaml - Sign in to the Jenkins console for your domain. See Access
the Jenkins Console.
- On the Dashboard page, click update domain.
- Click Build with Parameters.
- From Domain_Name, select the domain for which you want to deploy the applications.
- Select
Shared File System
from the Archive_Source list. - For Archive_File_Location, specify the
path of the archive zip file on the admin host
/u01/shared/path_to_your_archive.zip/archive.zip
. - Click Build.
ssh -i path_to_private_key
-o ProxyCommand="ssh -W %h:%p –i path_to_private_key
opc@bastion_public_ip" opc@admin_ip
Access the Deployed Applications
- From your computer, run the SSH
command to connect to the stack's Administration Server as the
opc
user. - Run the
kubectl
command to get the external load balancer IP address. - Access the deployed applications
using the following URLs:
https://
external_lb_ip/simpleear1 https:// external_lb_ip/simpleear2
ssh -i path_to_private_key
-o ProxyCommand="ssh -W %h:%p –i path_to_private_key
opc@bastion_public_ip" opc@admin_ip
kubectl get svc -A
Undeploy the Application
- From your computer, run the SSH
command to connect to the stack's Administration Server as the
opc
user. - Go to
/u01/shared
location and run the following commands to create an archive1.zip with WDTmodel.yaml
.zip -r archive1.zip wlsdeploy/applications/ model/model.yaml
- Sign in to the Jenkins
console for your domain. See Access
the Jenkins Console.
- On the Dashboard page, click update domain.
- Click Build with Parameters.
- From Domain_Name, select the domain for which you want to undeploy the application.
- Select
Shared File System
from the Archive_Source list. - For Archive_File_Location,,
specify the path of the archive zip file on the admin host
/u01/shared/path_to_your_archive1.zip/archive1.zip
. - Click Build.
To undeploy the simpleear2.ear
application, use the following model.yaml
file:
appDeployments: Application: simpleear1 : SourcePath: wlsdeploy/applications/simpleear1.ear Target: 'my-cluster' ModuleType: ear
ssh -i path_to_private_key
-o ProxyCommand="ssh -W %h:%p –i path_to_private_key
opc@bastion_public_ip" opc@admin_ip