2026-03-12 20:23:15

This commit is contained in:
root
2026-03-12 21:23:47 +01:00
parent eab4b36eca
commit 93039b8489
3332 changed files with 699614 additions and 0 deletions

View File

@@ -0,0 +1,75 @@
#!/usr/bin/python
# Author : Tim Hall
# Save Script as : deploy_app.py
#
# Requirements:
#
# Set the environment and start WLST
#
# export MW_HOME=/u01/app/oracle/middleware
# export DOMAIN_HOME=$MW_HOME/user_projects/domains/myDomain
# . $DOMAIN_HOME/bin/setDomainEnv.sh
# java weblogic.WLST
#
# Connect to the admin server and store the credentials.
#
# connect('weblogic', 'password1', 't3://myserver.localdomain:7001')
# configfile = '/home/oracle/scripts/appconfigfile.secure'
# keyfile = '/home/oracle/scripts/appkeyfile.secure'
# storeUserConfig(userConfigFile=configfile, userKeyFile=keyfile)
# disconnect()
# exit()
#
import time
import getopt
import sys
import re
# Get parameter values.
configfile = '/home/oracle/scripts/appconfigfile.secure'
keyfile = '/home/oracle/scripts/appkeyfile.secure'
adminurl = 't3://myserver.localdomain:7001'
app = ''
path = ''
targetlist = 'myServer_1'
try:
opts, args = getopt.getopt(sys.argv[1:],"p:a:t:h::",["path=","app=","targetlist="])
except getopt.GetoptError:
print 'deploy_birms_app.py -p <path-to-ear> [-a <application>] [-t <targetlist>]'
sys.exit(2)
for opt, arg in opts:
if opt == '-h':
print 'deploy_birms_app.py -p <path-to-ear> [-a <application>] [-t <targetlist>]'
sys.exit()
elif opt in ("-a", "--app"):
app = arg
elif opt in ("-p", "--path"):
path = arg
elif opt in ("-t", "--targetlist"):
targetlist = arg
if app == '':
app = os.path.basename(path)
app = os.path.splitext(app)[0]
print 'app=', app
print 'path=', path
print 'targetlist=', targetlist
# Undeploy then deploy the application.
connect(userConfigFile=configfile, userKeyFile=keyfile, url=adminurl)
#edit()
#startEdit()
try:
undeploy(app)
except:
print '**********************************************************'
print '***** Failed to undeploy. Is it a first-time deploy? *****'
print '**********************************************************'
deploy(app,path,targets=targetlist)
#save()
#activate()
disconnect()
exit()

View File

@@ -0,0 +1,16 @@
#!/bin/bash
path=$1
app=$2
targetlist=$3
export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=$MW_HOME/user_projects/domains/myDomain
. $DOMAIN_HOME/bin/setDomainEnv.sh
if [ "$app" != "" -a "$targetlist" = "" ]; then
java weblogic.WLST ~/scripts/deploy_app.py -p $path -a $app
elif [ "$app" != "" -a "$targetlist" != "" ] ; then
java weblogic.WLST ~/scripts/deploy_app.py -p $path -a $app -t $targetlist
else
java weblogic.WLST ~/scripts/deploy_app.py -p $path
fi

View File

@@ -0,0 +1,21 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/start-domain.sh
# Author : Tim Hall
# Description : Starts a WebLogic domain and managed server.
# Call Syntax : ./start-domain.sh
# Last Modified: 15-JUN-2013
# Notes : Amend DOMAIN_HOME and managed server name appropriately.
# -----------------------------------------------------------------------------------
export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=$MW_HOME/user_projects/domains/clusterDomain
echo "Starting AdminServer"
nohup $DOMAIN_HOME/startWebLogic.sh > /dev/null 2>&1 &
sleep 120
echo "Starting clusterServer_1"
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh clusterServer_1 > /dev/null 2>&1 &
sleep 60
echo "Done!"

View File

@@ -0,0 +1,29 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/start-forms-reports.sh
# Author : Tim Hall
# Description : Starts a WebLogic Forms and Reports Services installation.
# Call Syntax : ./start-forms-reports.sh
# Last Modified: 15-JUN-2013
# -----------------------------------------------------------------------------------
export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=$MW_HOME/user_projects/domains/ClassicDomain
export FR_INST=$MW_HOME/asinst_1
echo "Starting AdminServer"
nohup $DOMAIN_HOME/bin/startWebLogic.sh > /dev/null 2>&1 &
sleep 120
echo "Starting WLS_FORMS"
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_FORMS > /dev/null 2>&1 &
echo "Starting WLS_REPORTS"
nohup $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_REPORTS > /dev/null 2>&1 &
echo "Start remaining processes using OPMN"
$FR_INST/bin/opmnctl startall
echo "Sleep for 10 minutes before calling reports startserver"
sleep 600
curl http://localhost:8888/reports/rwservlet/startserver > /dev/null 2>&1 &
echo "Done!"

View File

@@ -0,0 +1,15 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/start-node-manager.sh
# Author : Tim Hall
# Description : Starts the WebLogic Node Manager
# Call Syntax : ./start-node-manager.sh
# Last Modified: 15-JUN-2013
# -----------------------------------------------------------------------------------
export MW_HOME=/u01/app/oracle/middleware
export WLS_HOME=$MW_HOME/wlserver_10.3
echo "Starting Node Manger"
nohup $WLS_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &
echo "Done!"

View File

@@ -0,0 +1,23 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/stop-domain.sh
# Author : Tim Hall
# Description : Stops a WebLogic domain and managed server.
# Call Syntax : ./stop-domain.sh
# Last Modified: 15-JUN-2013
# Notes : Amend DOMAIN_HOME and managed server name appropriately.
# -----------------------------------------------------------------------------------
export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=$MW_HOME/user_projects/domains/clusterDomain
echo "Stopping clusterServer_1"
$DOMAIN_HOME/bin/stopManagedWebLogic.sh clusterServer_1
echo "Stopping AdminServer"
$DOMAIN_HOME/bin/stopWebLogic.sh
echo "Tidy up temp files"
find $DOMAIN_HOME/servers -name "*.lok" -exec rm -f {} \;
find $DOMAIN_HOME/servers -name "*.DAT" -exec rm -f {} \;
echo "Done!"

View File

@@ -0,0 +1,28 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/stop-forms-reports.sh
# Author : Tim Hall
# Description : Stop a WebLogic Forms and Reports Services installation.
# Call Syntax : ./stop-forms-reports.sh
# Last Modified: 15-JUN-2013
# -----------------------------------------------------------------------------------
export MW_HOME=/u01/app/oracle/middleware
export DOMAIN_HOME=$MW_HOME/user_projects/domains/ClassicDomain
export FR_INST=$MW_HOME/asinst_1
echo "Stop OPMN processes"
$FR_INST/bin/opmnctl stopall
echo "Stop WLS_FORMS"
$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_FORMS
echo "Stop WLS_REPORTS"
$DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_REPORTS
echo "Stop AdminServer"
$DOMAIN_HOME/bin/stopWebLogic.sh
echo "Tidy up temp files"
find $DOMAIN_HOME/servers -name "*.lok" -exec rm -f {} \;
find $DOMAIN_HOME/servers -name "*.DAT" -exec rm -f {} \;
echo "Done!"

View File

@@ -0,0 +1,10 @@
# -----------------------------------------------------------------------------------
# File Name : https://oracle-base.com/dba/weblogic/stop-node-manager.sh
# Author : Tim Hall
# Description : Stops the WebLogic Node Manager by killing the processes.
# Call Syntax : ./stop-node-manager.sh
# Last Modified: 15-JUN-2013
# -----------------------------------------------------------------------------------
echo "Stopping Node Manger"
kill -9 `ps -ef | grep [N]odeManager | awk '{print $2}'`