-
Notifications
You must be signed in to change notification settings - Fork 2
/
deploy-applications.py
42 lines (32 loc) · 1006 Bytes
/
deploy-applications.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# deploy applications from the config file
import sys
# check a config file was specified
config_file = sys.argv[1]
if (config_file == None):
raise Error("must specify the config file")
exit()
# read the config file
data_file = open(config_file, 'r')
data = eval(data_file.read())
# look for the deployments
if (data["deployments"] == None):
print ("No deployments in the config file.. nothing to do")
exit()
# connect to weblogic
readDomain('/u01/oracle/domains/base_domain')
for deployment in data["deployments"]:
appname = deployment["name"]
apppkg = deployment["source"]
appdir = '/u01/oracle/applications'
cd('/')
app = create(appname, 'AppDeployment')
app.setSourcePath(apppkg)
app.setStagingMode('nostage')
# Assign application to AdminServer
# =================================
assign('AppDeployment', appname, 'Target', 'AdminServer')
# Update Domain, Close It, Exit
# ==========================
updateDomain()
closeDomain()
exit()