Skip to content

Commit e820f13

Browse files
authored
Merge pull request #4 from oracle/main
merge changes from oracle/weblogic-azure repo to gnsuryan/weblogic-azure repo.
2 parents b56ab95 + 05adbb5 commit e820f13

File tree

57 files changed

+718
-625
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+718
-625
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ vulnerability disclosure process.
3535

3636
## License
3737

38-
Copyright (c) 2021 Oracle and/or its affiliates.
38+
Copyright (c) 2021, Oracle and/or its affiliates.
3939

4040
Released under the Universal Permissive License v1.0 as shown at
4141
<https://oss.oracle.com/licenses/upl/>.

weblogic-azure-aks/src/main/arm/scripts/buildWLSDockerImage.sh

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@ function echo_stderr() {
66
echo "$@" >&2
77
}
88

9+
# PENDING(edburns): load <azureACRPassword> and <ocrSSOPSW> from filesystem, from a file that is guaranteed to be secured as required
10+
function load_parameters_from_file() {
11+
}
12+
913
#Function to display usage message
1014
function usage() {
11-
echo_stdout "./buildWLSDockerImage.sh <wlsImagePath> <azureACRServer> <azureACRUserName> <azureACRPassword> <imageTag> <appPackageUrls> <ocrSSOUser> <ocrSSOPSW> <wlsClusterSize>"
15+
echo_stdout "./buildWLSDockerImage.sh <wlsImagePath> <azureACRServer> <azureACRUserName> <imageTag> <appPackageUrls> <ocrSSOUser> <wlsClusterSize>"
1216
if [ $1 -eq 1 ]; then
1317
exit 1
1418
fi
@@ -34,13 +38,13 @@ function validate_inputs() {
3438
usage 1
3539
fi
3640

37-
if [ -z "$azureACRUserName" ]; then
38-
echo_stderr "azureACRUserName is required. "
41+
if [ -z "$azureACRPassword" ]; then
42+
echo_stderr "azureACRPassword is required. "
3943
usage 1
4044
fi
4145

42-
if [ -z "$azureACRPassword" ]; then
43-
echo_stderr "azureACRPassword is required. "
46+
if [ -z "$azureACRUserName" ]; then
47+
echo_stderr "azureACRUserName is required. "
4448
usage 1
4549
fi
4650

@@ -229,18 +233,18 @@ export scriptDir="$(cd "$(dirname "${script}")" && pwd)"
229233
export wlsImagePath=$1
230234
export azureACRServer=$2
231235
export azureACRUserName=$3
232-
export azureACRPassword=$4
233-
export imageTag=$5
234-
export appPackageUrls=$6
235-
export ocrSSOUser=$7
236-
export ocrSSOPSW=$8
237-
export wlsClusterSize=$9
236+
export imageTag=$4
237+
export appPackageUrls=$5
238+
export ocrSSOUser=$6
239+
export wlsClusterSize=$7
238240

239241
export acrImagePath="$azureACRServer/aks-wls-images:${imageTag}"
240242
export ocrLoginServer="container-registry.oracle.com"
241243
export wdtDownloadURL="https://github.com/oracle/weblogic-deploy-tooling/releases/download/release-1.9.7/weblogic-deploy.zip"
242244
export witDownloadURL="https://github.com/oracle/weblogic-image-tool/releases/download/release-1.9.11/imagetool.zip"
243245

246+
load_parameters_from_file
247+
244248
validate_inputs
245249

246250
initialize
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2021, Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
4+
echo "Script starts"
5+
6+
#Function to output message to stdout
7+
function echo_stderr() {
8+
echo "$@" >&2
9+
echo "$@" >>stdout
10+
}
11+
12+
function echo_stdout() {
13+
echo "$@" >&2
14+
echo "$@" >>stdout
15+
}
16+
17+
# PENDING(edburns): write some of the parameters to file. Others are passed directly to the script.
18+
function write_parameters_to_file() {
19+
}
20+
21+
22+
#Function to display usage message
23+
function usage() {
24+
echo_stdout "./invokeSetupWLSDomain.sh ..."
25+
if [ $1 -eq 1 ]; then
26+
exit 1
27+
fi
28+
}
29+
30+
#Function to validate input
31+
function validate_input() {
32+
33+
}
34+
35+
validate_input
36+
37+
# invoke the setupWLSDomain passing the parameters and the file
38+
39+
exit $exitCode

weblogic-azure-aks/src/main/arm/scripts/setupWLSDomain.sh

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@ function echo_stdout() {
1414
echo "$@" >>stdout
1515
}
1616

17+
# PENDING(edburns): load <wlsPassword> <wdtRuntimePassword> from filesystem, from a file that is guaranteed to be secured as required
18+
function load_parameters_from_file() {
19+
}
20+
21+
1722
#Function to display usage message
1823
function usage() {
19-
echo_stdout "./setupWLSDomain.sh <ocrSSOUser> <ocrSSOPSW> <aksClusterRGName> <aksClusterName> <wlsImageTag> <acrName> <wlsDomainName> <wlsDomainUID> <wlsUserName> <wlsPassword> <wdtRuntimePassword> <wlsCPU> <wlsMemory> <managedServerPrefix> <appReplicas> <appPackageUrls> <currentResourceGroup> <scriptURL> <storageAccountName> <wlsClusterSize>"
24+
echo_stdout "./setupWLSDomain.sh <ocrSSOUser> <ocrSSOPSW> <aksClusterRGName> <aksClusterName> <wlsImageTag> <acrName> <wlsDomainName> <wlsDomainUID> <wlsUserName> <wlsCPU> <wlsMemory> <managedServerPrefix> <appReplicas> <appPackageUrls> <currentResourceGroup> <scriptURL> <storageAccountName> <wlsClusterSize>"
2025
if [ $1 -eq 1 ]; then
2126
exit 1
2227
fi
@@ -245,7 +250,7 @@ function build_docker_image() {
245250
--publisher Microsoft.Azure.Extensions \
246251
--version 2.0 \
247252
--settings "{ \"fileUris\": [\"${scriptURL}model.yaml\",\"${scriptURL}model.properties\",\"${scriptURL}buildWLSDockerImage.sh\"]}" \
248-
--protected-settings "{\"commandToExecute\":\"bash buildWLSDockerImage.sh ${wlsImagePath} ${azureACRServer} ${azureACRUserName} ${azureACRPassword} ${newImageTag} \\\"${appPackageUrls}\\\" ${ocrSSOUser} ${ocrSSOPSW} ${wlsClusterSize}\"}"
253+
--protected-settings "{\"commandToExecute\":\"bash buildWLSDockerImage.sh ${wlsImagePath} ${azureACRServer} ${azureACRUserName} ${newImageTag} \\\"${appPackageUrls}\\\" ${ocrSSOUser} ${wlsClusterSize}\"}"
249254

250255
# If error fires, keep vm resource and exit.
251256
validate_status "Check status of buiding WLS domain image."
@@ -450,17 +455,15 @@ export acrName=$6
450455
export wlsDomainName=$7
451456
export wlsDomainUID=$8
452457
export wlsUserName=$9
453-
export wlsPassword=${10}
454-
export wdtRuntimePassword=${11}
455-
export wlsCPU=${12}
456-
export wlsMemory=${13}
457-
export managedServerPrefix=${14}
458-
export appReplicas=${15}
459-
export appPackageUrls=${16}
460-
export currentResourceGroup=${17}
461-
export scriptURL=${18}
462-
export storageAccountName=${19}
463-
export wlsClusterSize=${20}
458+
export wlsCPU=${10}
459+
export wlsMemory=${11}
460+
export managedServerPrefix=${12}
461+
export appReplicas=${13}
462+
export appPackageUrls=${14}
463+
export currentResourceGroup=${15}
464+
export scriptURL=${16}
465+
export storageAccountName=${17}
466+
export wlsClusterSize=${18}
464467

465468
export adminServerName="admin-server"
466469
export exitCode=0
@@ -475,6 +478,8 @@ export wlsOptNameSpace="weblogic-operator-ns"
475478
export wlsOptRelease="weblogic-operator"
476479
export wlsOptSA="weblogic-operator-sa"
477480

481+
load_parameters_from_file
482+
478483
validate_input
479484

480485
install_utilities

weblogic-azure-aks/src/main/bicep/modules/_deployment-scripts/_ds-create-wls-cluster.bicep

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ param ocrSSOPSW string
1818
param ocrSSOUser string
1919
param storageAccountName string = 'null'
2020
param utcValue string = utcNow()
21-
@secure()
22-
param wdtRuntimePassword string
21+
param wdtRuntimePassword string = 'welcome1'
2322
param wlsClusterSize int = 5
2423
param wlsCPU string = '200m'
2524
param wlsDomainName string = 'domain1'
@@ -35,6 +34,7 @@ var const_domainTemplate = 'domain.yaml.template'
3534
var const_pvTempalte = 'pv.yaml.template'
3635
var const_pvcTempalte = 'pvc.yaml.template'
3736
var const_scriptLocation = uri(_artifactsLocation, 'scripts/')
37+
var const_invokeSetUpDomainScript = 'invokeSetupWLSDomain.sh'
3838
var const_setUpDomainScript = 'setupWLSDomain.sh'
3939

4040
resource deploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
@@ -45,8 +45,9 @@ resource deploymentScript 'Microsoft.Resources/deploymentScripts@2020-10-01' = {
4545
properties: {
4646
azCliVersion: '2.15.0'
4747
arguments: const_arguments
48-
primaryScriptUri: uri(const_scriptLocation, '${const_setUpDomainScript}${_artifactsLocationSasToken}')
48+
primaryScriptUri: uri(const_scriptLocation, '${const_invokeSetUpDomainScript}${_artifactsLocationSasToken}')
4949
supportingScriptUris: [
50+
uri(const_scriptLocation, '${const_setUpDomainScript}${_artifactsLocationSasToken}')
5051
uri(const_scriptLocation, '${const_domainTemplate}${_artifactsLocationSasToken}')
5152
uri(const_scriptLocation, '${const_pvTempalte}${_artifactsLocationSasToken}')
5253
uri(const_scriptLocation, '${const_pvcTempalte}${_artifactsLocationSasToken}')

weblogic-azure-vm/arm-oraclelinux-wls-admin/admin-ssl-post-deploy/src/main/scripts/configureCustomAdminSSL.sh

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ function wait_for_admin()
154154
{
155155
#wait for admin to start
156156
count=1
157-
export CHECK_URL="http://$wlsAdminURL/weblogic/ready"
157+
CHECK_URL="http://$wlsAdminURL/weblogic/ready"
158158
status=`curl --insecure -ILs $CHECK_URL | tac | grep -m1 HTTP/1.1 | awk {'print $2'}`
159159
echo "Waiting for admin server to start"
160160
while [[ "$status" != "200" ]]
@@ -193,7 +193,7 @@ function parseLDAPCertificate()
193193
done
194194

195195
openssl base64 -d -in ${SCRIPT_PWD}/security/AzureADLDAPCerBase64String.txt -out ${SCRIPT_PWD}/security/AzureADTrust.cer
196-
export addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer
196+
addsCertificate=${SCRIPT_PWD}/security/AzureADTrust.cer
197197
}
198198

199199
function importAADCertificateIntoWLSCustomTrustKeyStore()
@@ -254,7 +254,7 @@ function parseAndSaveCustomSSLKeyStoreData()
254254

255255
echo "$customIdentityKeyStoreBase64String" > ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt
256256
cat ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/identity.keystore
257-
export customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore
257+
customSSLIdentityKeyStoreFile=${KEYSTORE_PATH}/identity.keystore
258258

259259
rm -rf ${KEYSTORE_PATH}/identityKeyStoreCerBase64String.txt
260260

@@ -263,7 +263,7 @@ function parseAndSaveCustomSSLKeyStoreData()
263263

264264
echo "$customTrustKeyStoreBase64String" > ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt
265265
cat ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt | base64 -d > ${KEYSTORE_PATH}/trust.keystore
266-
export customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore
266+
customSSLTrustKeyStoreFile=${KEYSTORE_PATH}/trust.keystore
267267

268268
rm -rf ${KEYSTORE_PATH}/trustKeyStoreCerBase64String.txt
269269

@@ -279,7 +279,7 @@ function restartAdminServerService()
279279

280280
#main script starts here
281281

282-
export SCRIPT_PWD=`pwd`
282+
SCRIPT_PWD=`pwd`
283283

284284
# store arguments in a special array
285285
args=("$@")
@@ -288,51 +288,51 @@ ELEMENTS=${#args[@]}
288288

289289
# echo each element in array
290290
# for loop
291-
for (( i=0;i<$ELEMENTS;i++)); do
292-
echo "ARG[${args[${i}]}]"
293-
done
291+
#for (( i=0;i<$ELEMENTS;i++)); do
292+
# echo "ARG[${args[${i}]}]"
293+
#done
294294

295295
if [ $# -lt 9 ]
296296
then
297297
usage
298298
exit 1
299299
fi
300300

301-
export adminVMName=$1
302-
export wlsDomainName=$2
303-
export wlsUserName=$3
304-
export wlsPassword=$4
305-
export oracleHome=$5
306-
export wlsDomainPath=$6
301+
adminVMName=$1
302+
wlsDomainName=$2
303+
wlsUserName=$3
304+
wlsPassword=$4
305+
oracleHome=$5
306+
wlsDomainPath=$6
307307

308-
export enableAAD="${7}"
308+
enableAAD="${7}"
309309
enableAAD="${enableAAD,,}"
310310

311-
export wlsADSSLCer="${8}"
311+
wlsADSSLCer="${8}"
312312

313-
export isCustomSSLEnabled="${9}"
313+
isCustomSSLEnabled="${9}"
314314
isCustomSSLEnabled="${isCustomSSLEnabled,,}"
315315

316316
if [ "${isCustomSSLEnabled,,}" == "true" ];
317317
then
318-
export customIdentityKeyStoreBase64String="${10}"
319-
export customIdentityKeyStorePassPhrase="${11}"
320-
export customIdentityKeyStoreType="${12}"
321-
export customTrustKeyStoreBase64String="${13}"
322-
export customTrustKeyStorePassPhrase="${14}"
323-
export customTrustKeyStoreType="${15}"
324-
export privateKeyAlias="${16}"
325-
export privateKeyPassPhrase="${17}"
318+
customIdentityKeyStoreBase64String="${10}"
319+
customIdentityKeyStorePassPhrase="${11}"
320+
customIdentityKeyStoreType="${12}"
321+
customTrustKeyStoreBase64String="${13}"
322+
customTrustKeyStorePassPhrase="${14}"
323+
customTrustKeyStoreType="${15}"
324+
privateKeyAlias="${16}"
325+
privateKeyPassPhrase="${17}"
326326
fi
327327

328-
export wlsAdminPort=7001
329-
export wlsAdminChannelPort=7005
330-
export wlsAdminURL="$adminVMName:$wlsAdminChannelPort"
331-
export wlsServerName="admin"
332-
export username="oracle"
333-
export groupname="oracle"
328+
wlsAdminPort=7001
329+
wlsAdminChannelPort=7005
330+
wlsAdminURL="$adminVMName:$wlsAdminChannelPort"
331+
wlsServerName="admin"
332+
username="oracle"
333+
groupname="oracle"
334334

335-
export KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores"
335+
KEYSTORE_PATH="$wlsDomainPath/$wlsDomainName/keystores"
336336

337337
validateInput
338338
cleanup

weblogic-azure-vm/arm-oraclelinux-wls-admin/cli-scripts/custom-dns-alias-cli.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function queryAdminIPId() {
107107
exit 1
108108
fi
109109

110-
export adminIPId=$(az graph query -q "Resources
110+
adminIPId=$(az graph query -q "Resources
111111
| where type =~ 'microsoft.network/networkinterfaces'
112112
| where id=~ '${nicId}'
113113
| extend ipConfigsCount=array_length(properties.ipConfigurations)
@@ -122,7 +122,7 @@ function queryAdminIPId() {
122122
}
123123

124124
function generateParameterFile() {
125-
export parametersPath=parameters.json
125+
parametersPath=parameters.json
126126
cat <<EOF >${scriptDir}/${parametersPath}
127127
{
128128
"\$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
@@ -230,8 +230,8 @@ Custom DNS alias:
230230

231231
# main script start from here
232232
# default value
233-
export hasDNSZone=false
234-
export identity=/subscriptions/subscriptionId/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestUserIdentity1
233+
hasDNSZone=false
234+
identity=/subscriptions/subscriptionId/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestUserIdentity1
235235

236236
# Transform long options to short ones
237237
for arg in "$@"; do

weblogic-azure-vm/arm-oraclelinux-wls-admin/src/main/arm/mainTemplate.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,11 @@
303303
"defaultValue": "ServerPrivateKeyPassPhraseSecret"
304304
},
305305
"uploadedCustomIdentityKeyStoreData": {
306-
"type": "string",
306+
"type": "securestring",
307307
"metadata": {
308308
"description": "Custom Identity KeyStore Data"
309309
},
310-
"defaultValue": "customIdentityKeyStoreData"
310+
"defaultValue": ""
311311
},
312312
"uploadedCustomIdentityKeyStorePassphrase": {
313313
"type": "securestring",
@@ -324,11 +324,11 @@
324324
"defaultValue": "JKS"
325325
},
326326
"uploadedCustomTrustKeyStoreData": {
327-
"type": "string",
327+
"type": "securestring",
328328
"metadata": {
329329
"description": "Custom Trust KeyStore Data"
330330
},
331-
"defaultValue": "customTrustKeyStoreData"
331+
"defaultValue": ""
332332
},
333333
"uploadedCustomTrustKeyStorePassPhrase": {
334334
"type": "securestring",

0 commit comments

Comments
 (0)