Skip to content

Commit 70f3ba1

Browse files
committed
Fix wls on aks automation script. Allow customized domain inputs.
1 parent dfbfa89 commit 70f3ba1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

kubernetes/samples/scripts/create-weblogic-domain-on-azure-kubernetes-service/create-domain-on-aks.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function usage {
4444
# Parse the command line options
4545
#
4646
executeIt=false
47-
while getopts "ehi:o:u:" opt; do
47+
while getopts "ehi:o:u:d:" opt; do
4848
case $opt in
4949
i) valuesInputFile="${OPTARG}"
5050
;;
@@ -77,7 +77,7 @@ if [ "${missingRequiredOption}" == "true" ]; then
7777
usage 1
7878
fi
7979

80-
if [ -z "${azureResourceUID}" ];then
80+
if [ -z "${azureResourceUID}" ];then
8181
azureResourceUID=`date +%s`
8282
fi
8383

@@ -205,7 +205,7 @@ function createYamlFiles {
205205
if [ -z ${domainInputFile} ]; then
206206
domainInputFile="${dirCreateDomain}/create-domain-inputs.yaml"
207207
fi
208-
208+
209209
cp ${domainInputFile} ${domain1Output}
210210
sed -i -e "s;^image\:.*;image\: ${weblogicDockerImage};g" ${domain1Output}
211211
sed -i -e "s:#imagePullSecretName.*:imagePullSecretName\: ${imagePullSecretName}:g" ${domain1Output}
@@ -215,7 +215,7 @@ function createYamlFiles {
215215

216216
# Parse domain configuration yaml for usage in load balancer
217217
exportValuesFile=$(mktemp /tmp/export-values-XXXXXXXXX.sh)
218-
tmpFile=$(mktemp /tmp/javaoptions_tmp-XXXXXXXXX.dat)
218+
tmpFile=$(mktemp /tmp/javaoptions_tmp-XXXXXXXXX.dat)
219219
parseYaml ${domain1Output} ${exportValuesFile}
220220
if [ ! -f ${exportValuesFile} ]; then
221221
echo Unable to locate the parsed output of ${domain1Output}.
@@ -227,7 +227,7 @@ function createYamlFiles {
227227
cat ${exportValuesFile}
228228
echo
229229
# javaOptions may contain tokens that are not allowed in export command
230-
# we need to handle it differently.
230+
# we need to handle it differently.
231231
# we set the javaOptions variable that can be used later
232232
tmpStr=`grep "javaOptions" ${exportValuesFile}`
233233
javaOptions=${tmpStr//"javaOptions="/}
@@ -240,7 +240,7 @@ function createYamlFiles {
240240
# Generate the yaml to create load balancer for Administration Server.
241241
echo Generating ${adminLbOutput}
242242

243-
cp ${wlsLbInput} ${adminLbOutput}
243+
cp ${wlsLbInput} ${adminLbOutput}
244244
sed -i -e "s:%SELECTOR_SERVER_TYPE%:${selectorAdminServerName}:g" ${adminLbOutput}
245245
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${adminLbOutput}
246246
sed -i -e "s:%SERVER_PORT%:${adminPort}:g" ${adminLbOutput}
@@ -275,7 +275,7 @@ function createResourceGroup {
275275
# Create a resource group
276276
echo Check if ${azureResourceGroupName} exists
277277
ret=$(az group exists --name ${azureResourceGroupName})
278-
if [ $ret != false ];then
278+
if [ $ret != false ];then
279279
fail "${azureResourceGroupName} exists, please change value of namePrefix to generate a new resource group name."
280280
fi
281281

@@ -287,7 +287,7 @@ function createAndConnectToAKSCluster {
287287
# Create aks cluster
288288
echo Check if ${aksClusterName} exists
289289
ret=$(az aks list -g ${azureResourceGroupName} | grep "${aksClusterName}")
290-
if [ -n "$ret" ];then
290+
if [ -n "$ret" ];then
291291
fail "AKS instance with name ${aksClusterName} exists."
292292
fi
293293

@@ -313,7 +313,7 @@ function createFileShare {
313313
echo Check if the storage account ${storageAccountName} exists.
314314
ret=$(az storage account check-name --name ${storageAccountName})
315315
nameAvailable=$(echo "$ret" | grep "nameAvailable" | grep "false")
316-
if [ -n "$nameAvailable" ];then
316+
if [ -n "$nameAvailable" ];then
317317
echo $ret
318318
fail "Storage account ${aksClusterName} is unavaliable."
319319
fi
@@ -332,7 +332,7 @@ function createFileShare {
332332
# Create the file share
333333
echo Check if file share exists
334334
ret=$( az storage share exists --name ${azureStorageShareName} --account-name ${storageAccountName} --connection-string $azureStorageConnectionString | grep "exists" | grep false)
335-
if [ $ret == true ];then
335+
if [[ "$ret" == "true" ]];then
336336
fail "File share name ${azureStorageShareName} is unavaliable."
337337
fi
338338

@@ -508,7 +508,7 @@ createYamlFiles
508508
# All done if the execute option is true
509509
if [ "${executeIt}" = true ]; then
510510
511-
# Login Azure with service pricipal
511+
# Login Azure with service principal
512512
loginAzure
513513
514514
# Create resource group

0 commit comments

Comments
 (0)