diff --git a/OracleSOASuite/COPYRIGHT b/OracleSOASuite/COPYRIGHT new file mode 100644 index 0000000000..29a070604d --- /dev/null +++ b/OracleSOASuite/COPYRIGHT @@ -0,0 +1,20 @@ +Copyright (c) 2003 - 2017, Oracle Corporation. All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/OracleSOASuite/LICENSE b/OracleSOASuite/LICENSE new file mode 100644 index 0000000000..2970b5248f --- /dev/null +++ b/OracleSOASuite/LICENSE @@ -0,0 +1,3 @@ +Unless otherwise noted, all files in this folder are released +under the Common Development and Distribution License (CDDL) 1.0 +and GNU Public License 2.0 licenses. diff --git a/OracleSOASuite/README.md b/OracleSOASuite/README.md new file mode 100644 index 0000000000..02ca1560ba --- /dev/null +++ b/OracleSOASuite/README.md @@ -0,0 +1,24 @@ +Oracle SOA Suite/BPM on Docker +============================== +Sample Docker build file to facilitate installation, configuration, and environment setup for DevOps users for Release 12.2.1.2.0. For more information check out +[Oracle Fusion Middleware](http://www.oracle.com/technetwork/middleware/fusion-middleware/overview/index.html) specifically the sections on +- Service Integration (SOA) +- Business Process Management + +## What is included +- Sample docker file to build an image containing a pre-configured SOA, BPM or OSB domain +- Docker Compose file to start an instance of the Database, Admin Server and a Managed Server + +## How to build +[Please review this README file](dockerfiles/README.md) + +## How to run +[Please review this README file](samples/README.md) + +## License +To download and run Oracle Fusion Middleware, regardless whether inside or outside a Docker container, you must download the binaries from the Oracle website and accept the license indicated at that page. + +All scripts and files hosted in this project and GitHub [docker-images/OracleSOABPM](./) repository required to build the Docker images are, unless otherwise noted, released under the Common Development and Distribution License (CDDL) 1.0 and GNU Public License 2.0 licenses. + +## Copyright +Copyright (c) 2014-2017 Oracle and/or its affiliates. All rights reserved. diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile new file mode 100644 index 0000000000..1dd4aea593 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/Dockerfile @@ -0,0 +1,45 @@ +# LICENSE CDDL 1.0 + GPL 2.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +# ORACLE DOCKERFILES PROJECT +# -------------------------- +# This is the Dockerfile for Oracle SOA Suite 12.2.1.2 +# +# REQUIRED FILES TO BUILD THIS IMAGE +# ---------------------------------- +# See soasuite.download file in this directory +# +# Pull base image +# --------------- +FROM middleware/fmw-infrastructure:12.2.1.2 +# +# Maintainer +# ---------- +MAINTAINER Prashanth Nagaraja +# +# Environment variables required for this build (do NOT change) +# ------------------------------------------------------------- +USER root +ENV FMW_JAR1=fmw_12.2.1.2.0_soa.jar \ + FMW_JAR2=fmw_12.2.1.2.0_osb.jar + +# +# Copy files and packages for install +# ----------------------------------- +ADD $FMW_JAR1 $FMW_JAR2 /u01/ +COPY container-scripts/* /u01/oracle/dockertools/ +RUN cd /u01 && chmod 755 *.jar && chmod a+xr /u01/oracle/dockertools/*.* +# +USER oracle +COPY *.response oraInst.loc /u01/ +RUN cd /u01 && \ + $JAVA_HOME/bin/java -jar $FMW_JAR1 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME && \ + $JAVA_HOME/bin/java -jar $FMW_JAR2 -silent -responseFile /u01/soasuite.response -invPtrLoc /u01/oraInst.loc -jreLoc $JAVA_HOME -ignoreSysPrereqs -force -novalidation ORACLE_HOME=$ORACLE_HOME INSTALL_TYPE="Service Bus" && \ + rm -f /u01/*.jar /u01/oraInst.loc /u01/*.response + +# +# Define default command to start bash. +# +WORKDIR $ORACLE_HOME +CMD ["/u01/oracle/dockertools/createDomainAndStart.sh"] diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py new file mode 100755 index 0000000000..4845d1beae --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomain.py @@ -0,0 +1,475 @@ +import os +import sys + +import com.oracle.cie.domain.script.jython.WLSTException as WLSTException + +class SOA12212Provisioner: + + MACHINES = { + 'machine1' : { + 'NMType': 'SSL', + 'ListenAddress': 'localhost', + 'ListenPort': 5658 + } + } + + SOA_CLUSTERS = { + 'soa_cluster' : {} + } + + OSB_CLUSTERS = { + 'osb_cluster' : {} + } + + SERVERS = { + 'AdminServer' : { + 'ListenAddress': '', + 'ListenPort': 7001, + 'Machine': 'machine1' + } + + } + + SOA_SERVERS = { + 'soa_server1' : { + 'ListenAddress': '', + 'ListenPort': 8001, + 'Machine': 'machine1', + 'Cluster': 'soa_cluster' + } + } + + OSB_SERVERS = { + 'osb_server1' : { + 'ListenAddress': '', + 'ListenPort': 9001, + 'Machine': 'machine1', + 'Cluster': 'osb_cluster' + } + } + + + JRF_12212_TEMPLATES = { + 'baseTemplate' : '@@ORACLE_HOME@@/wlserver/common/templates/wls/wls.jar', + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.jrf.ws.async_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.wsmpm_template.jar', + '@@ORACLE_HOME@@/oracle_common/common/templates/wls/oracle.ums_template.jar', + '@@ORACLE_HOME@@/em/common/templates/wls/oracle.em_wls_template.jar' + ], + 'serverGroupsToTarget' : [ 'JRF-MAN-SVR', 'WSMPM-MAN-SVR' ] + } + + SOA_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.soa_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + OSB_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/osb/common/templates/wls/oracle.osb_template.jar' + ], + 'serverGroupsToTarget' : [ 'OSB-MGD-SVRS-ONLY' ] + } + + BPM_12212_TEMPLATES = { + 'extensionTemplates' : [ + '@@ORACLE_HOME@@/soa/common/templates/wls/oracle.bpm_template.jar' + ], + 'serverGroupsToTarget' : [ 'SOA-MGD-SVRS-ONLY' ] + } + + def __init__(self, oracleHome, javaHome, domainParentDir): + self.oracleHome = self.validateDirectory(oracleHome) + self.javaHome = self.validateDirectory(javaHome) + self.domainParentDir = self.validateDirectory(domainParentDir, create=True) + return + + def configureXADataSources(self): + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/EDNDataSource/JdbcResource/EDNDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + return + + def createDomain(self, name, user, password, db, dbPrefix, dbPassword,domainType): + domainHome = self.createBaseDomain(name, user, password,domainType) + + if domainType == "soa" or domainType == "soaosb": + self.extendSoaDomain(domainHome, db, dbPrefix, dbPassword) + + if domainType == "osb" or domainType == "soaosb" : + self.extendOsbDomain(domainHome, db, dbPrefix, dbPassword,domainType) + + if domainType == "bpm": + self.extendBpmDomain(domainHome, db, dbPrefix, dbPassword) + + + def createBaseDomain(self, name, user, password,domainType): + baseTemplate = self.replaceTokens(self.JRF_12212_TEMPLATES['baseTemplate']) + + readTemplate(baseTemplate) + setOption('DomainName', name) + setOption('JavaHome', self.javaHome) + setOption('ServerStartMode', 'prod') + set('Name', domainName) + cd('/Security/' + domainName + '/User/weblogic') + set('Name', user) + set('Password', password) + + + print 'INFO: Creating Node Managers...' + for machine in self.MACHINES: + cd('/') + create(machine, 'Machine') + cd('Machine/' + machine) + create(machine, 'NodeManager') + cd('NodeManager/' + machine) + for param in self.MACHINES[machine]: + set(param, self.MACHINES[machine][param]) + + print 'INFO: Creating Admin server...' + + for server in self.SERVERS: + cd('/') + if server == 'AdminServer': + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + continue + create(server, 'Server') + cd('Server/' + server) + for param in self.SERVERS[server]: + set(param, self.SERVERS[server][param]) + + if domainType == "soa" or domainType == "bpm" or domainType == "soaosb": + for cluster in self.SOA_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.SOA_CLUSTERS[cluster]: + set(param, self.SOA_CLUSTERS[cluster][param]) + + for server in self.SOA_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.SOA_SERVERS[server]: + set(param, self.SOA_SERVERS[server][param]) + + print 'INFO: SOA Servers created.....' + + if domainType == 'osb' or domainType == "soaosb": + + print 'INFO: Creating OSB cluster...' + for cluster in self.OSB_CLUSTERS: + cd('/') + create(cluster, 'Cluster') + cd('Cluster/' + cluster) + for param in self.OSB_CLUSTERS[cluster]: + set(param, self.OSB_CLUSTERS[cluster][param]) + + for server in self.OSB_SERVERS: + cd('/') + create(server, 'Server') + cd('Server/' + server) + for param in self.OSB_SERVERS[server]: + set(param, self.OSB_SERVERS[server][param]) + + + print 'INFO: OSB Servers created.....' + setOption('OverwriteDomain', 'true') + domainHome = self.domainParentDir + '/' + name + + print 'INFO: Writing base domain...' + writeDomain(domainHome) + closeTemplate() + print 'INFO: Base domain created at ' + domainHome + return domainHome + + + def readAndApplyJRFTemplates(self, domainHome): + print 'INFO: Extending domain at ' + domainHome + readDomain(domainHome) + setOption('AppDir', self.domainParentDir + '/applications') + + print 'INFO: Applying JRF templates...' + for extensionTemplate in self.JRF_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def applySOATemplates(self): + print 'INFO: Applying SOA templates...' + for extensionTemplate in self.SOA_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + return + + def configureJDBCTemplates(self,db,dbPrefix,dbPassword): + print 'INFO: Configuring the Service Table DataSource...' + fmwDb = 'jdbc:oracle:thin:@' + db + cd('/JDBCSystemResource/LocalSvcTblDataSource/JdbcResource/LocalSvcTblDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.OracleDriver') + set('URL', fmwDb) + set('PasswordEncrypted', dbPassword) + + stbUser = dbPrefix + '_STB' + cd('Properties/NO_NAME_0/Property/user') + set('Value', stbUser) + + print 'INFO: Getting Database Defaults...' + getDatabaseDefaults() + return + + def targetSOAServers(self,serverGroupsToTarget): + for server in self.SOA_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetSOACluster(self): + for cluster in self.SOA_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + + def targetOSBServers(self,serverGroupsToTarget): + for server in self.OSB_SERVERS: + if not server == 'AdminServer': + setServerGroups(server, serverGroupsToTarget) + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for server:" + server + cd('/Servers/' + server) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def targetOSBCluster(self): + for cluster in self.OSB_CLUSTERS: + print "INFO: Set CoherenceClusterSystemResource to defaultCoherenceCluster for cluster:" + cluster + cd('/Cluster/' + cluster) + set('CoherenceClusterSystemResource', 'defaultCoherenceCluster') + return + + def extendSoaDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + self.applySOATemplates() + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.SOA_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendOsbDomain(self, domainHome, db, dbPrefix, dbPassword,domainType): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying OSB templates...' + for extensionTemplate in self.OSB_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + cd('/JDBCSystemResources/SOADataSource/JdbcResource/SOADataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + cd('/JDBCSystemResources/OraSDPMDataSource/JdbcResource/OraSDPMDataSource') + cd('JDBCDriverParams/NO_NAME_0') + set('DriverName', 'oracle.jdbc.xa.client.OracleXADataSource') + + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.OSB_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetOSBServers(serverGroupsToTarget) + + cd('/') + self.targetOSBCluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.OSB_CLUSTERS) + "]" + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.OSB_CLUSTERS)) + + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + def extendBpmDomain(self, domainHome, db, dbPrefix, dbPassword): + self.readAndApplyJRFTemplates(domainHome) + + print 'INFO: Applying BPM templates...' + for extensionTemplate in self.BPM_12212_TEMPLATES['extensionTemplates']: + addTemplate(self.replaceTokens(extensionTemplate)) + + print 'INFO: Extension Templates added' + + self.configureJDBCTemplates(db,dbPrefix,dbPassword) + self.configureXADataSources() + + print 'INFO: Targeting Server Groups...' + serverGroupsToTarget = list(self.JRF_12212_TEMPLATES['serverGroupsToTarget']) + serverGroupsToTarget.extend(self.BPM_12212_TEMPLATES['serverGroupsToTarget']) + + cd('/') + self.targetSOAServers(serverGroupsToTarget) + + cd('/') + self.targetSOACluster() + + print "INFO: Set WLS clusters as target of defaultCoherenceCluster:[" + ",".join(self.SOA_CLUSTERS) + "]" + + cd('/CoherenceClusterSystemResource/defaultCoherenceCluster') + set('Target', ",".join(self.SOA_CLUSTERS)) + print 'INFO: Preparing to update domain...' + updateDomain() + print 'INFO: Domain updated successfully' + closeDomain() + return + + + ########################################################################### + # Helper Methods # + ########################################################################### + + def validateDirectory(self, dirName, create=False): + directory = os.path.realpath(dirName) + if not os.path.exists(directory): + if create: + os.makedirs(directory) + else: + message = 'Directory ' + directory + ' does not exist' + raise WLSTException(message) + elif not os.path.isdir(directory): + message = 'Directory ' + directory + ' is not a directory' + raise WLSTException(message) + return self.fixupPath(directory) + + + def fixupPath(self, path): + result = path + if path is not None: + result = path.replace('\\', '/') + return result + + + def replaceTokens(self, path): + result = path + if path is not None: + result = path.replace('@@ORACLE_HOME@@', oracleHome) + return result + +############################# +# Entry point to the script # +############################# + +def usage(): + print sys.argv[0] + ' -oh -jh -parent [-name ] ' + \ + '[-user ] [-password ] ' + \ + '-rcuDb [-rcuPrefix ] [-rcuSchemaPwd ] ' + \ + '-domainType ' + sys.exit(0) + + +print "createDomain.py called with the following inputs:" +for index, arg in enumerate(sys.argv): + print "INFO: sys.argv[" + str(index) + "] = " + str(sys.argv[index]) + +if len(sys.argv) < 6: + usage() + +#oracleHome will be passed by command line parameter -oh. +oracleHome = None +#javaHome will be passed by command line parameter -jh. +javaHome = None +#domainParentDir will be passed by command line parameter -parent. +domainParentDir = None +#domainName is hard-coded to soa_domain. You can change to other name of your choice. Command line parameter -name. +domainName = 'soa_domain' +#domainUser is hard-coded to weblogic. You can change to other name of your choice. Command line paramter -user. +domainUser = 'weblogic' +#domainPassword is hard-coded to welcome1. You can change to other password of your choice. Command line parameter -password. +domainPassword = 'welcome1' +#rcuDb will be passed by command line parameter -rcuDb. +rcuDb = None +#change rcuSchemaPrefix to your soainfra schema prefix. Command line parameter -rcuPrefix. +rcuSchemaPrefix = 'DEV12' +#change rcuSchemaPassword to your soainfra schema password. Command line parameter -rcuSchemaPwd. +rcuSchemaPassword = 'welcome1' + +i = 1 +while i < len(sys.argv): + if sys.argv[i] == '-oh': + oracleHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-jh': + javaHome = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-parent': + domainParentDir = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-name': + domainName = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-user': + domainUser = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-password': + domainPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuDb': + rcuDb = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuPrefix': + rcuSchemaPrefix = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-rcuSchemaPwd': + rcuSchemaPassword = sys.argv[i + 1] + i += 2 + elif sys.argv[i] == '-domainType': + domainType = sys.argv[i + 1] + i += 2 + else: + print 'INFO: Unexpected argument switch at position ' + str(i) + ': ' + str(sys.argv[i]) + usage() + sys.exit(1) + + +provisioner = SOA12212Provisioner(oracleHome, javaHome, domainParentDir) +provisioner.createDomain(domainName, domainUser, domainPassword, rcuDb, rcuSchemaPrefix, rcuSchemaPassword,domainType) diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh new file mode 100755 index 0000000000..1b3f10dd9c --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/createDomainAndStart.sh @@ -0,0 +1,246 @@ +#!/bin/bash +# +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================== +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function _kill() { + echo "INFO: SIGKILL received, shutting down Admin Server!" + /u01/oracle/user_projects/domains/base_domain/bin/stopWebLogic.sh + exit; +} + +#================================================== +function rand_pwd(){ + while true; do + s=$(cat /dev/urandom | tr -dc "A-Za-z0-9" | fold -w 8 | head -n 1) + if [[ ${#s} -ge 8 && "$s" = *[A-Z]* && "$s" = *[a-z]* && "$s" = *[0-9]* ]] + then + break + else + echo "INFO: Password does not Match the criteria, re-generating..." >&2 + fi + done + echo "INFO: ${s}" +} + +#================================================== +setupRCU() { + dbType=`echo ${CONNECTION_STRING} | cut -d "/" -f2` + scrName=/u01/oracle/oracle_common/common/sql/iau/scripts/creAuditTabs.sql + + if [ ! -s "${scrName}.orig" ]; then + echo "INFO: Copying RCU backup file" + cp ${scrName} ${scrName}.orig + fi + + if [ "${dbType}" = "XE" -o "${dbType}" = "xe" ]; then + echo "INFO: Setting RCU for XE" + sed -e "s/^@@prepareAuditView.sql/-- @@prepareAuditView.sql/g" ${scrName}.orig > ${scrName} + else + echo "INFO: Setting RCU for ORCL" + cp ${scrName}.orig ${scrName} + fi +} + +#================================================== +updateListenAddress() { + mkdir -p ${DOMAIN_HOME}/logs + + export thehost=`hostname -I` + echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" + cmd="/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name ${thehost} AdminServer ${ADMIN_HOST}" + echo ${cmd} + ${cmd} > ${DOMAIN_HOME}/logs/aslisten.log 2>&1 +} + +#================================================== +#== MAIN starts here... +#================================================== +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +echo "INFO: CONNECTION_STRING = ${CONNECTION_STRING:?"Please set CONNECTION_STRING"}" +echo "INFO: RCUPREFIX = ${RCUPREFIX:?"Please set RCUPREFIX"}" + +if [ -z ${DB_PASSWORD} ] +then + echo "" + echo "FATAL: DB System password is empty. Exiting..." + exit 1 +fi; + +if [ -z ${ADMIN_PASSWORD} ] +then + # Auto generate Oracle WebLogic Server admin password + ADMIN_PASSWORD=$(rand_pwd) + echo "" + echo "INFO: Oracle WebLogic Server Password Auto Generated :" + echo " 'weblogic' admin password: $ADMIN_PASSWORD" + echo "" +fi; + +if [ -z ${DB_SCHEMA_PASSWORD} ] +then + # Auto generate Oracle Database Schema password + temp_pwd=$(rand_pwd) + #Password should not start with a number for database + f_str=`echo $temp_pwd|cut -c1|tr [0-9] [A-Z]` + s_str=`echo $temp_pwd|cut -c2-` + DB_SCHEMA_PASSWORD=${f_str}${s_str} + echo "" + echo "INFO: Database Schema password Auto Generated :" + echo " Database schema password: $DB_SCHEMA_PASSWORD" + echo "" +fi + +export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING +export vol_name=u01 + +echo -e $DB_PASSWORD"\n"$DB_SCHEMA_PASSWORD > /tmp/pwd.txt + +CTR_DIR=/$vol_name/oracle/user_projects/container/${DOMAIN_NAME} + +# +# Creating schemas needed for sample domain #### +#=============================================== +# +RUN_RCU="true" +CONFIGURE_DOMAIN="true" + +if [ -d $CTR_DIR ] +then + # First load the Env Data from the env file... + if [ -e $CTR_DIR/contenv.sh ] + then + . $CTR_DIR/contenv.sh + #reset the JDBC URL + export jdbc_url="jdbc:oracle:thin:@"$CONNECTION_STRING + fi +else + mkdir -p $CTR_DIR +fi + +if [ -e $CTR_DIR/RCU.$RCUPREFIX.suc ] +then + #RCU has already been executed successfully, no need to rerun + RUN_RCU="false" + echo "INFO: SOA RCU has already been loaded. Skipping..." +fi + +if [ "$RUN_RCU" = "true" ] +then + setupRCU + # Run the RCU.. it hasnt been loaded before. If it has + # then drop the prefix and restart. New Domain creation + # scenario + echo "INFO: Dropping Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -selectDependentsForComponents true -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + + echo "INFO: Creating Schema $RCUPREFIX..." + /$vol_name/oracle/oracle_common/bin/rcu -silent -createRepository -databaseType ORACLE -connectString $CONNECTION_STRING -dbUser sys -dbRole sysdba -useSamePasswordForAllSchemaUsers true -selectDependentsForComponents true -variables SOA_PROFILE_TYPE=SMALL,HEALTHCARE_INTEGRATION=NO -schemaPrefix $RCUPREFIX -component OPSS -component STB -component SOAINFRA -f < /tmp/pwd.txt + retval=$? + + if [ $retval -ne 0 ]; + then + echo "ERROR: RCU Loading Failed. Check the RCU logs" + exit + else + # Write the rcu suc file... + touch $CTR_DIR/RCU.$RCUPREFIX.suc + + # Write the env file.. such that the passwords etc.. will be saved and we will + # be able to restart from the RCU + cat > $CTR_DIR/contenv.sh <> $CTR_DIR/SOA.DOMAINCFG.suc + + cat > $CTR_DIR/contenv.sh < $DOMAIN_HOME/servers/AdminServer/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/AdminServer/security/boot.properties + +# +# Password less Managed Server starting +#====================================== +echo "username=weblogic" > $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties +echo "password="$ADMIN_PASSWORD >> $DOMAIN_HOME/servers/${MANAGED_SERVER}/security/boot.properties + +# +# Setting env variables +#======================= +echo ". $DOMAIN_HOME/bin/setDomainEnv.sh" >> /u01/oracle/.bashrc +echo "export PATH=$PATH:/u01/oracle/common/bin:$DOMAIN_HOME/bin" >> /u01/oracle/.bashrc + +# Now we start the Admin server in this container... +/u01/oracle/dockertools/startAS.sh + +sleep infinity diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh new file mode 100755 index 0000000000..78f6fb457e --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startAS.sh @@ -0,0 +1,52 @@ +#!/bin/sh +# +# Author: vivek.raj@oracle.com +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# +#************************************************************************* +# script is used to start a WebLogic Admin server. +#************************************************************************* +export DOMAIN_HOME=$DOMAIN_ROOT/$DOMAIN_NAME + +# Start Admin server +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/as.log +STSFILE=${LOGDIR}/as.status +mkdir -p ${LOGDIR} +rm -f ${LOGFILE} ${STSFILE} + +echo "INFO: Starting the Admin Server..." +echo "INFO: Logs = ${LOGFILE}" +$DOMAIN_HOME/bin/startWebLogic.sh > ${LOGFILE} 2>&1 & + +statusfile=/tmp/notifyfifo.$$ +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + + # remember tail's PID + tailpid=$! + + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 " " + + # notify the first pipeline stage that grep is done + echo "RUNNING" > ${STSFILE} + echo "INFO: Admin server is running" + echo > ${statusfile} +} + +# clean up +rm "${statusfile}" +if [ -f ${STSFILE} ]; then + echo "INFO: Admin server running, ready to start managed server" +fi diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh new file mode 100755 index 0000000000..eba56720bb --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/startMS.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# +# Author:vivek.raj@oracle.com + +export DOMAIN_NAME=${DOMAIN_NAME:-soainfra} +export DOMAIN_ROOT=${DOMAIN_ROOT:-/u01/oracle/user_projects/domains} +export DOMAIN_HOME=${DOMAIN_ROOT}/${DOMAIN_NAME} + +#================================================================= +function _int() { + echo "INFO: Stopping container." + echo "INFO: SIGINT received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +function _term() { + echo "INFO: Stopping container." + echo "INFO: SIGTERM received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +function _kill() { + echo "INFO: SIGKILL received, shutting down Managed Server!" + $DOMAIN_HOME/bin/stopManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} + exit; +} + +#================================================================= +#== MAIN Starts here... +#================================================================= +trap _int SIGINT +trap _term SIGTERM +trap _kill SIGKILL + +export vol_name=u01 + +if [ "$DOMAIN_TYPE" = "soa" ] || [ "$DOMAIN_TYPE" = "bpm" ] +then + grepPat="SOA Platform is running and accepting requests" +elif [ "$DOMAIN_TYPE" = "osb" ] +then + grepPat=" " +else + echo "ERROR: Invalid domain type. Cannot start the servers" + exit +fi + +LOGDIR=${DOMAIN_HOME}/logs +LOGFILE=${LOGDIR}/ms.log +mkdir -p ${LOGDIR} + +export thehost=`hostname -I` +echo "INFO: Updating the listen address - ${thehost} ${ADMIN_HOST}" +/u01/oracle/oracle_common/common/bin/wlst.sh -skipWLSModuleScanning /u01/oracle/dockertools/updListenAddress.py $vol_name $thehost ${MANAGED_SERVER} ${ADMIN_HOST} > ${LOGDIR}/mslisten.log 2>&1 + +# Start SOA server +echo "INFO: Starting the managed server ${MANAGED_SERVER}" +$DOMAIN_HOME/bin/startManagedWebLogic.sh ${MANAGED_SERVER} "http://"${ADMIN_HOST}:${ADMIN_PORT} > ${LOGFILE} 2>&1 & +statusfile=/tmp/notifyfifo.$$ + +echo "INFO: Waiting for the Managed Server to accept requests..." +mkfifo "${statusfile}" || exit 1 +{ + # run tail in the background so that the shell can kill tail when notified + # that grep has exited + tail -f ${LOGFILE} & + # remember tail's PID + tailpid=$! + # wait for notification that grep has exited + read templine <${statusfile} + echo ${templine} + # grep has exited, time to go + kill "${tailpid}" +} | { + grep -m 1 "${grepPat}" + # notify the first pipeline stage that grep is done + echo "RUNNING"> ${LOGDIR}/ms.status + echo "INFO: Managed Server is running" + echo >${statusfile} +} + +# clean up +rm "${statusfile}" +if [ -f ${LOGDIR}/ms.status ]; then + echo "INFO: Managed server has been started" +fi + +childPID=$! +wait $childPID diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py new file mode 100755 index 0000000000..e06eb38a89 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/container-scripts/updListenAddress.py @@ -0,0 +1,44 @@ +#!/usr/bin/python +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +# Updates the listen address for managed server with the IP address of the host. +# ============================================== +# +import sys +# +# Assigning values to variables +# ============================= +domain_name = os.environ.get("DOMAIN_NAME", "soainfra") +domain_root = os.environ.get("DOMAIN_ROOT", "/u01/oracle/user_projects/domains") + +# +# Reading db details and schema prefix passed from parent script +# ============================================================== +vol_name=sys.argv[1] +manserver_host=sys.argv[2] +server=sys.argv[3] +exthost=sys.argv[4] +# +# Setting domain path +# =================== +domain_path = domain_root + '/' + domain_name +# +# +# +# Read domain for updates +# ======================= +readDomain(domain_path) +# +# +# Set listen address +# ================== +cd('/') +cd('/Server/'+server) +cmo.setListenAddress(manserver_host) +cmo.setExternalDNSName(exthost) + +# Creating domain +# ============================== +updateDomain() +closeDomain() +exit() diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/oraInst.loc b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/oraInst.loc new file mode 100644 index 0000000000..01f1964a55 --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/oraInst.loc @@ -0,0 +1,2 @@ +inventory_loc=/u01/oracle/.inventory +inst_group=oracle diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download new file mode 100644 index 0000000000..c6c825387e --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.download @@ -0,0 +1,10 @@ +# +# Download Oracle SOA Suite for Oracle Middleware (BPM, FMW, SOA) OTN: +# http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html +# +# - V789369-01.zip - Oracle Fusion Middleware 12c (12.2.1.2.0) SOA Suite +# and Business Process Management +# - V779126-01.zip - Oracle Fusion Middleware 12c (12.2.1.2.0) Service Bus +# +87bc97d2240150930262249812b24a1a fmw_12.2.1.2.0_soa.jar +208dc087e3cbb679e6938d8416d1bf39 fmw_12.2.1.2.0_osb.jar diff --git a/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response new file mode 100644 index 0000000000..19faeb98bc --- /dev/null +++ b/OracleSOASuite/dockerfiles/12.2.1.2-soabpm/soasuite.response @@ -0,0 +1,15 @@ +# LICENSE CDDL 1.0 + GPL 2.0 +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. +[ENGINE] + +#DO NOT CHANGE THIS. +Response File Version=1.0.0.0.0 + +[GENERIC] +#INSTALL_TYPE=JDeveloper with Business Process Management +#INSTALL_TYPE=Service Bus +INSTALL_TYPE=BPM + +DECLINE_SECURITY_UPDATES=true +SECURITY_UPDATES_VIA_MYORACLESUPPORT=false diff --git a/OracleSOASuite/dockerfiles/README.md b/OracleSOASuite/dockerfiles/README.md new file mode 100644 index 0000000000..afb733630d --- /dev/null +++ b/OracleSOASuite/dockerfiles/README.md @@ -0,0 +1,22 @@ +How to Build the image +====================== +Before you Start +---------------- +1. **FIRST TIME ONLY** + - Update the OracleSOABPM/setenv.sh file to point + to the right locations for the following environment variables + specific to your environment (See top of file) + DC_USERHOME, DC_REGISTRY_SOA, DC_REGISTRY_DB + +SOA|BPM|OSB Domain images +------------------------- +1. You must have the install binaries downloaded from the + [Oracle Technology Network](http://www.oracle.com/technetwork/middleware/soasuite/downloads/index.html) site before proceeding. +2. From the current directory OracleSOABPM/dockerfiles, run + these commands. You will be prompted with all the + information. Carefully review it and Confirm to proceed. + + ```sh +# Use BUILD_OPTS to add extra arguments to the docker build command +sh buildDockerImage.sh -v 12.2.1.2-soabpm + ``` diff --git a/OracleSOASuite/dockerfiles/buildDockerImage.sh b/OracleSOASuite/dockerfiles/buildDockerImage.sh new file mode 100755 index 0000000000..0ee7ce5aa5 --- /dev/null +++ b/OracleSOASuite/dockerfiles/buildDockerImage.sh @@ -0,0 +1,145 @@ +#!/bin/bash +# +# Script to build a Docker image for Oracle SOA suite. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. +# +# Copyright (c) 2016-2017 Oracle and/or its affiliates. All rights reserved. + +#============================================================= +usage() { +cat << EOF + +Usage: buildDockerImage.sh -v [version] + +Builds a Docker Image for Oracle SOA/OSB/BPM +Parameters: + -h: view usage + -v: Release version to build. Required. Allowed values are + 12.2.1.2-soabpm + -s: Skip checksum verification + +LICENSE CDDL 1.0 + GPL 2.0 +Copyright (c) 2016-2017: Oracle and/or its affiliates. All rights reserved. + +EOF +exit 0 +} + +#============================================================= +checksumPackages() { + echo "INFO: Checking if required packages are present and valid..." + md5sum -c *.download 2> /dev/null + if [ "$?" -ne 0 ]; then + cat < $IMAGE_NAME +INFO: Build completed in $BUILD_ELAPSED seconds. + +EOF +else + echo "ERROR: Oracle SOA Docker Image was NOT successfully created. Check the output and correct any reported problems with the docker build operation." +fi diff --git a/OracleSOASuite/samples/README.md b/OracleSOASuite/samples/README.md new file mode 100644 index 0000000000..c1c4ea4009 --- /dev/null +++ b/OracleSOASuite/samples/README.md @@ -0,0 +1,45 @@ +# Docker Compose to Orchestrate Containers + +1. **FIRST TIME ONLY** + - Update the OracleSOABPM/setenv.sh file to point + to the right locations for the following environment variables + specific to your environment (See top of file) + DC_USERHOME, DC_REGISTRY_SOA, DC_REGISTRY_DB + +2. Setup your current environment + ```sh +exec bash (To replace your current shell with bash) +# cd OracleSOASuite/samples +. ../setenv.sh +``` + +3. Setup and start the Database + - Ensure port 1521 is free for use for the database + + ```sh +netstat -an | grep 1521 +``` + - Start the DB Container + + ```sh +docker-compose up -d soadb +docker logs -f soadb + ``` + +4. Starting the Admin Server Container. **DB MUST BE UP** + - Start AS - First Run will run RCU and create the SOA schemas, + Create the needed Domain (SOA/OSB/BPM etc) and Start the Admin + Server + - Subsequent runs should simply start the Admin Server + + ```sh +docker-compose up -d soaas +docker logs -f soaas + ``` + +5. Starting the Managed Server Container **ADMINSERVER MUST BE UP** + + ```sh +docker-compose up -d soams +docker logs -f soams + ``` diff --git a/OracleSOASuite/samples/docker-compose.yml b/OracleSOASuite/samples/docker-compose.yml new file mode 100644 index 0000000000..26a150d0ad --- /dev/null +++ b/OracleSOASuite/samples/docker-compose.yml @@ -0,0 +1,147 @@ +version: "3.0" + +services: + # + # The Oracle DB Definition + # + soadb: + image: ${DC_REGISTRY_DB}/oracle/database:12.2.0.1-ee + ports: + - "${DC_ORCL_PORT}:1521" + - "${DC_ORCL_OEM_PORT}:5500" + environment: + - ORACLE_SID=${DC_ORCL_SID} + - ORACLE_PDB=${DC_ORCL_PDB} + - ORACLE_PWD=${DC_ORCL_SYSPWD} + container_name: soadb + volumes: + - ${DC_ORCL_DBDATA}:/opt/oracle/oradata + + # + # The SOA Admin Server + # + soaas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: soaas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=soa + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_SOAPFX} + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_SOA}:/u01/oracle/user_projects + + # + # The SOA Managed Server + # + soams: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: soams + depends_on: + - "soaas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "8001:8001" + - "8002:8002" + environment: + - DOMAIN_TYPE=soa + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_SOA}:/u01/oracle/user_projects + + # + # The BPM Admin Server + # + bpmas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: bpmas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=bpm + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_BPMPFX} + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_BPM}:/u01/oracle/user_projects + + # + # The BPM Managed Server + # + bpmms: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: bpmms + depends_on: + - "bpmas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "8001:8001" + - "8002:8002" + environment: + - DOMAIN_TYPE=bpm + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=soa_server1 + volumes: + - ${DC_DDIR_BPM}:/u01/oracle/user_projects + + # + # The OSB Admin Server + # + osbas: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: osbas + command: /bin/bash -c "sleep 5s; /u01/oracle/dockertools/createDomainAndStart.sh" + ports: + - "7001:7001" + environment: + - DOMAIN_TYPE=osb + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PASSWORD=${DC_ADMIN_PWD} + - CONNECTION_STRING=${DC_ORCL_HOST}:${DC_ORCL_PORT}/${DC_ORCL_PDB} + - DB_PASSWORD=${DC_ORCL_SYSPWD} + - DB_SCHEMA_PASSWORD=${DC_RCU_SCHPWD} + - RCUPREFIX=${DC_RCU_OSBPFX} + - MANAGED_SERVER=osb_server1 + volumes: + - ${DC_DDIR_OSB}:/u01/oracle/user_projects + + # + # The OSB Managed Server + # + osbms: + image: ${DC_REGISTRY_SOA}/middleware/soabpm:12.2.1.2 + container_name: osbms + depends_on: + - "osbas" + command: /bin/bash -c "/u01/oracle/dockertools/startMS.sh" + ports: + - "9001:9001" + - "9002:9002" + environment: + - DOMAIN_TYPE=osb + - ADMIN_HOST=${DC_HOSTNAME} + - ADMIN_PORT=7001 + - adminhostname=${DC_HOSTNAME} + - adminport=7001 + - MANAGED_SERVER=osb_server1 + volumes: + - ${DC_DDIR_OSB}:/u01/oracle/user_projects diff --git a/OracleSOASuite/setenv.sh b/OracleSOASuite/setenv.sh new file mode 100755 index 0000000000..3bbfda9330 --- /dev/null +++ b/OracleSOASuite/setenv.sh @@ -0,0 +1,70 @@ +#!/bin/sh +# +#=============================================== +# MUST: Customize this to your local env +#=============================================== +# +# Directory where all domains/db data etc are +# kept. Directories will be created here +export DC_USERHOME=/scratch/${USER}/docker + +# Registry names where requisite standard images +# can be found +export DC_REGISTRY_SOA="localhost" +export DC_REGISTRY_DB="localhost" + +# Proxy Environment +export http_proxy="" +export https_proxy="" +export no_proxy="" + +#=============================================== +exportComposeEnv() { + # + export DC_HOSTNAME=`hostname -f` + # + # Used by Docker Compose from the env + # Oracle DB Parameters + # + export DC_ORCL_PORT=1521 + export DC_ORCL_OEM_PORT=5500 + export DC_ORCL_SID=soadb + export DC_ORCL_PDB=soapdb + export DC_ORCL_SYSPWD= + export DC_ORCL_HOST=${DC_HOSTNAME} + # + export DC_ORCL_DBDATA=${DC_USERHOME}/dbdata + # + # AdminServer Password + # + export DC_ADMIN_PWD= + # + # RCU Common password for all schemas + Prefix Names + # + export DC_RCU_SCHPWD= + export DC_RCU_SOAPFX=SOA01 + export DC_RCU_BPMPFX=BPM01 + export DC_RCU_OSBPFX=OSB01 + # + # Domain directories for the various domain types + # + export DC_DDIR_SOA=${DC_USERHOME}/soadomain + export DC_DDIR_BPM=${DC_USERHOME}/bpmdomain + export DC_DDIR_OSB=${DC_USERHOME}/osbdomain +} + +#=============================================== +createDirs() { + mkdir -p ${DC_ORCL_DBDATA} ${DC_DDIR_SOA} ${DC_DDIR_BPM} ${DC_DDIR_OSB} + chmod 777 ${DC_ORCL_DBDATA} ${DC_DDIR_SOA} ${DC_DDIR_BPM} ${DC_DDIR_OSB} +} + +#=============================================== +#== MAIN starts here +#=============================================== +# +echo "INFO: Setting up SOA Docker Environment..." +exportComposeEnv +createDirs +#echo "INFO: Environment variables" +#env | grep -e "DC_" | sort