Previous on WLSDM blog, we have learned about "WLSDM Scheduler: How to delete/move WebLogic logs automatically and visualize the CRON job".
In this blog post, let’s learn how to deploy an application to WebLogic server via WLSDM "User Defined Action / Script" and WLSDM inbox feature "Scheduler Job".
The performance of WebLogic domains can be improved by using shell/WLST scripts and these scripts can be executed at a specific time. At this time WLSDM helps us to schedule jobs to automate scripts for WebLogic domains. WLSDM scheduler able to run scripts which are already defined as "cron expression".
Let's learn how "WLSDM Scheduled Jobs" works while deploying applications to WebLogic domains?
Adding WebLogic scripts in WLSDM
1. WLSDM scheduler job types are "Downtime (WLSDM Monitoring)" and "User Defined Actions / Scripts". We will write and use a WLST script for deploying applications to WebLogic domains to use in the "WLSDM Scheduled Jobs".
DeployApplication.py: Deploys web application to a WebLogic Domain
connect('weblogic', 'welcome1', 't3://localhost:7001') deploy('WaitWebService', 'D:/Oracle/applications/web_service/webservicewebapp.war', targets='ManagedServer_1') exit()
Batch script (.cmd) that calls DeployApplication.py:
2. Go to "WLSDM Console > Configuration > Monitoring & Diagnostics" page and open "Page Operations" menu, then click on “New User Defined Action / Script” button.
3. Define script name, select "script source type (file or embeded)" and enter script's full path.
WLSDM Scheduled Job
4. Switch to “Scheduled Jobs / Downtime” tab.
5. In the page operation menu click on “New Scheduled Jobs / Downtime” button then in the modal window add new CRON job as below and save.
6. After 1 hour (current time +hour), check your script status. In the tutorial the time is 5 minutes for the test purpose. Give your exact deployment time in the Step-5.
7. To check script status and output, click "View Output" button in the modal window. We can see that the deployment script/automation worked successfully. We can also see the failed job results, so we can fix the script.
8. When the application is deployed successfully to the WebLogic server, WLSDM sends an email health notification as below.
If you already read this technical blog post; please also watch the entire technical screencast it will inspire you about your PRODUCTION environment monitoring and automation cases. Especially about WebLogic cron job integrations and definitions.
Youtube Screencast Tutorial:
Deploy applications via WLSDM Scheduled Jobs to WebLogic domains.