Skip to content

Commit c805927

Browse files
committed
improve script comments
1 parent eb5599f commit c805927

File tree

2 files changed

+28
-11
lines changed

2 files changed

+28
-11
lines changed

documentation/site/content/samples/azure-kubernetes-service/includes/create-aks-cluster-body-01.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The following steps will direct you to accept the license agreement for WebLogic
44

55
- In a web browser, navigate to https://container-registry.oracle.com and log in using the Oracle Single Sign-On authentication service. If you do not already have SSO credentials, at the top of the page, click the **Sign In** link to create them.
66
- The Oracle Container Registry provides a WebLogic 12.2.1.4 General Availability (GA) installation image that is used in this sample.
7-
- Navigate to **Middleware**, then **weblogic**.
7+
- In the Oracle Container Registry, navigate to **Middleware**, then **weblogic**.
88
- On the left, choose a language and accept the license agreement. You will then see a message such as: "You last accepted the Oracle Standard Terms and Restrictions on 08/10/2020 at 06:12 AM Coordinated Universal Time (UTC)."
99
- **NOTE**: General Availability (GA) images are suitable for demonstration and development purposes _only_ where the environments are not available from the public Internet; they are **not
1010
acceptable for production use**. In production, you should always use CPU (patched) images

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

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ envValidate() {
136136
echo "Checking host environment passed."
137137
}
138138

139+
#
140+
# Function to prompt the user for input
141+
# $1 - parameter name
142+
# $2 - parameter type
143+
# $3 - parameter length
144+
# $4 - default value
139145
inputParameter() {
140146
local paramName="$1"
141147
local parmType="$2"
@@ -157,6 +163,9 @@ inputParameter() {
157163
fi
158164
}
159165

166+
#
167+
# Function to prompt the user for password input
168+
# $1 - parameter name
160169
inputPassword() {
161170
local paramName="$1"
162171

@@ -176,6 +185,9 @@ inputPassword() {
176185
fi
177186
}
178187

188+
#
189+
# Function to prompt the user for email input
190+
# $1 - parameter name
179191
inputEmail() {
180192
local paramName="$1"
181193

@@ -190,6 +202,9 @@ inputEmail() {
190202
fi
191203
}
192204

205+
#
206+
# Function to print the parameters
207+
#
193208
print_parameters() {
194209
print_green "image_build_branch_name=${image_build_branch_name}"
195210
print_green "image_build_base_dir=${image_build_base_dir}"
@@ -206,6 +221,7 @@ print_parameters() {
206221
print_green "azureStorageShareName=${azureStorageShareName}"
207222
print_green "oracleSsoK8sSecretName=${oracleSsoK8sSecretName}"
208223
print_green "domainUID=${domainUID}"
224+
print_green "sampleScriptsDir=${sampleScriptsDir}"
209225
}
210226

211227
parametersValidate() {
@@ -278,10 +294,14 @@ parametersValidate() {
278294
if [ -z "${weblogicAccountPassword}" ]; then
279295
inputPassword "Password of weblogic user account"
280296
export weblogicAccountPassword=$inputValue
281-
fi
297+
fi
298+
299+
ssoAccountValidate
282300

283301
print_parameters
302+
}
284303

304+
ssoAccountValidate() {
285305
print_step "Validate Oracle SSO Account. Make sure docker is running."
286306
# Attempt to login to Docker
287307
sudo chmod 666 /var/run/docker.sock
@@ -332,8 +352,9 @@ initialize() {
332352
export azureKubernetesNodepoolName="${azureKubernetesNodepoolNamePrefix}${namePrefix}"
333353
export azureStorageShareName="${AKS_PERS_SHARE_NAME}"
334354
export domainUID="${domainUID}"
355+
export sampleScriptsDir=${BASE_DIR}/sample-scripts
335356

336-
print_parameters
357+
print_parameters
337358
}
338359

339360
createResourceGroup() {
@@ -512,10 +533,10 @@ createWebLogicDomain() {
512533
echo Creating WebLogic Server domain ${domainUID}
513534

514535
# create credentials
515-
cd ${image_build_base_dir}/sample-scripts/create-weblogic-domain-credentials
536+
cd ${sampleScriptsDir}/create-weblogic-domain-credentials
516537
./create-weblogic-credentials.sh -u ${weblogicUserName} -p ${weblogicAccountPassword} -d ${domainUID}
517538

518-
cd ${image_build_base_dir}/sample-scripts/create-kubernetes-secrets
539+
cd ${sampleScriptsDir}/create-kubernetes-secrets
519540
./create-docker-credentials-secret.sh -s ${oracleSsoK8sSecretName} -e ${dockerEmail} -p ${dockerPassword} -u ${dockerEmail}
520541

521542
# generate yaml
@@ -796,16 +817,12 @@ buildDomainOnPvImage() {
796817

797818
## Build image
798819
cd ${image_build_base_dir}
799-
mkdir sample-scripts
800-
curl -m 120 -fL https://github.com/oracle/weblogic-kubernetes-operator/releases/download/${image_build_branch_name}/sample-scripts.zip \
801-
-o ${image_build_base_dir}/sample-scripts/sample-scripts.zip
802-
unzip ${image_build_base_dir}/sample-scripts/sample-scripts.zip -d ${image_build_base_dir}/sample-scripts
803820

804821
mkdir -p ${image_build_base_dir}/sample
805-
cp -r ${image_build_base_dir}/sample-scripts/create-weblogic-domain/domain-on-pv/* ${image_build_base_dir}/sample
822+
cp -r ${sampleScriptsDir}/create-weblogic-domain/domain-on-pv/* ${image_build_base_dir}/sample
806823

807824
mkdir -p ${image_build_base_dir}/sample/wdt-artifacts
808-
cp -r ${image_build_base_dir}/sample-scripts/create-weblogic-domain/wdt-artifacts/* ${image_build_base_dir}/sample/wdt-artifacts
825+
cp -r ${sampleScriptsDir}/create-weblogic-domain/wdt-artifacts/* ${image_build_base_dir}/sample/wdt-artifacts
809826

810827
cd ${image_build_base_dir}/sample/wdt-artifacts
811828

0 commit comments

Comments
 (0)