Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ public boolean execute() {
}

// check exitValue to determine if the command execution has failed.
if (params.verbose()) {
if (result.exitValue() != 0) {
getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result);
} else {
if (result.exitValue() != 0) {
getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result);
} else {
if (params.verbose()) {
getLogger().info("The command execution succeeded with result: {0}.", result);
}
}
}

return result.exitValue() == 0;
} catch (IOException | InterruptedException ie) {
Expand Down
4 changes: 3 additions & 1 deletion kubernetes/samples/scripts/common/wdt-and-wit-utility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,12 @@ function run_wdt {

cd $WDT_DIR || return 1

mkdir ${action}

cmd="
$wdt_bin_dir/extractDomainResource.sh
-oracle_home $oracle_home
-domain_resource_file domain${action}.yaml
-output_dir ./${action}
-domain_home $domain_home_dir
-model_file $model_final
-variable_file $inputs_final
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function createDomainHome {
# When using WDT to create a domain, a job to create a domain is started. It then creates
# a pod which will run a script that creates a domain. The script then will extract the domain
# resource using WDT's extractDomainResource tool. So, the following code loops until the
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
# domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file.

if [ "$useWdt" = true ]; then
POD_NAME=`kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '`
Expand All @@ -227,18 +227,18 @@ function createDomainHome {
sleep 30
max=30
count=0
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create"
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
while [ $? -eq 1 -a $count -lt $max ]; do
sleep 5
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create"
count=`expr $count + 1`
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
done
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml

# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called
# The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into
# the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called
# doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits.

touch doneExtract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ kubernetes:

# Identify which Secret contains the credentials for pulling an image
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%":

%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%"
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
# how to create that Secret at the end of this file)
webLogicCredentialsSecret:
Expand Down Expand Up @@ -63,19 +62,19 @@ kubernetes:
serverPod:
# an (optional) list of environment variable to be set on the servers
env:
JAVA_OPTIONS:
- name: JAVA_OPTIONS
value: "%JAVA_OPTIONS%"
USER_MEM_ARGS:
- name: USER_MEM_ARGS
value: "-Djava.security.egd=file:/dev/./urandom "
%OPTIONAL_SERVERPOD_RESOURCES%
%LOG_HOME_ON_PV_PREFIX%volumes:
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
%LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%'
%LOG_HOME_ON_PV_PREFIX%volumeMounts:
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%

%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
# adminServer is used to configure the desired behavior for starting the administration server.
adminServer:
# serverStartState legal values are "RUNNING" or "ADMIN"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ function createDomainHome {
# When using WDT to create a domain, a job to create a domain is started. It then creates
# a pod which will run a script that creates a domain. The script then will extract the domain
# resource using WDT's extractDomainResource tool. So, the following code loops until the
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
# domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file.

if [ "$useWdt" = true ]; then
POD_NAME=$(getPodName "${JOB_NAME}" "${namespace}")
Expand All @@ -219,16 +219,16 @@ function createDomainHome {
sleep 30
max=30
count=0
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
while [ $? -eq 1 -a $count -lt $max ]; do
sleep 5
count=`expr $count + 1`
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
done
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml

# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called
# The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into
# the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called
# doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits.

touch doneExtract
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ function updateDomainHome {
sleep 30
max=30
count=0
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml"
while [ $? -eq 1 -a $count -lt $max ]; do
sleep 5
count=`expr $count + 1`
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml"
done
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domainupdate.yaml ${domainOutputDir}/domain.yaml
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/update/wko-domain.yaml ${domainOutputDir}/domain.yaml

# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ kubernetes:

# Identify which Secret contains the credentials for pulling an image
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%":

%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%"
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
# how to create that Secret at the end of this file)
webLogicCredentialsSecret:
Expand Down Expand Up @@ -64,19 +63,19 @@ kubernetes:
serverPod:
# an (optional) list of environment variable to be set on the servers
env:
JAVA_OPTIONS:
- name: JAVA_OPTIONS
value: "%JAVA_OPTIONS%"
USER_MEM_ARGS:
- name: USER_MEM_ARGS
value: "-Djava.security.egd=file:/dev/./urandom "
%OPTIONAL_SERVERPOD_RESOURCES%
%LOG_HOME_ON_PV_PREFIX%volumes:
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
%LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%'
%LOG_HOME_ON_PV_PREFIX%volumeMounts:
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%

%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
# adminServer is used to configure the desired behavior for starting the administration server.
adminServer:
# serverStartState legal values are "RUNNING" or "ADMIN"
Expand Down