Skip to content

Commit

Permalink
[v3.1.x] Execute the profile optimization script explicitly to apply …
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
chirangaalwis authored and DilanUA committed Apr 2, 2020
1 parent 4a0214c commit 753e52e
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 3 deletions.
26 changes: 25 additions & 1 deletion dockerfiles/alpine/apim/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -e
# volume mounts
config_volume=${WORKING_DIRECTORY}/wso2-config-volume
artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume
patch_volume=${WORKING_DIRECTORY}/wso2-patch-volume
# home of the directories to be artifact synced within the WSO2 product home
deployment_volume=${WSO2_SERVER_HOME}/repository/deployment/server
# home of the directories with preserved, default deployment artifacts
Expand Down Expand Up @@ -49,10 +50,33 @@ for shared_directory in ${directories[@]}; do
fi
done

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
if [[ ! -z "${PROFILE_NAME}" ]]
then
echo "Optimizing WSO2 Carbon Server" >&2
sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

# copy any configuration changes mounted to config_volume
test -d ${config_volume} && [[ "$(ls -A ${config_volume})" ]] && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/
# copy any artifact changes mounted to artifact_volume
test -d ${artifact_volume} && [[ "$(ls -A ${artifact_volume})" ]] && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/

# copy any patches mounted to patch_volume
if [[ ! `test -d ${WSO2_SERVER_HOME}/updates/wum` ]]
then
test -d ${patch_volume} && [[ "$(ls -A ${patch_volume})" ]] \
&& echo "Copying critical patch fixes to GA pack" \
&& cp -RL ${patch_volume}/* ${WSO2_SERVER_HOME}/
fi

# start WSO2 Carbon server
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
echo "Start WSO2 Carbon server" >&2
if [[ -z "${PROFILE_NAME}" ]]
then
# start the server with the provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
else
# start the server with the specified profile and provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh -Dprofile=${PROFILE_NAME} "$@"
fi
26 changes: 25 additions & 1 deletion dockerfiles/centos/apim/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -e
# volume mounts
config_volume=${WORKING_DIRECTORY}/wso2-config-volume
artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume
patch_volume=${WORKING_DIRECTORY}/wso2-patch-volume
# home of the directories to be artifact synced within the WSO2 product home
deployment_volume=${WSO2_SERVER_HOME}/repository/deployment/server
# home of the directories with preserved, default deployment artifacts
Expand Down Expand Up @@ -49,10 +50,33 @@ for shared_directory in ${directories[@]}; do
fi
done

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
if [[ ! -z "${PROFILE_NAME}" ]]
then
echo "Optimizing WSO2 Carbon Server" >&2
sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

# copy any configuration changes mounted to config_volume
test -d ${config_volume} && [[ "$(ls -A ${config_volume})" ]] && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/
# copy any artifact changes mounted to artifact_volume
test -d ${artifact_volume} && [[ "$(ls -A ${artifact_volume})" ]] && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/

# copy any patches mounted to patch_volume
if [[ ! `test -d ${WSO2_SERVER_HOME}/updates/wum` ]]
then
test -d ${patch_volume} && [[ "$(ls -A ${patch_volume})" ]] \
&& echo "Copying critical patch fixes to GA pack" \
&& cp -RL ${patch_volume}/* ${WSO2_SERVER_HOME}/
fi

# start WSO2 Carbon server
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
echo "Start WSO2 Carbon server" >&2
if [[ -z "${PROFILE_NAME}" ]]
then
# start the server with the provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
else
# start the server with the specified profile and provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh -Dprofile=${PROFILE_NAME} "$@"
fi
26 changes: 25 additions & 1 deletion dockerfiles/ubuntu/apim/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -e
# volume mounts
config_volume=${WORKING_DIRECTORY}/wso2-config-volume
artifact_volume=${WORKING_DIRECTORY}/wso2-artifact-volume
patch_volume=${WORKING_DIRECTORY}/wso2-patch-volume
# home of the directories to be artifact synced within the WSO2 product home
deployment_volume=${WSO2_SERVER_HOME}/repository/deployment/server
# home of the directories with preserved, default deployment artifacts
Expand Down Expand Up @@ -49,10 +50,33 @@ for shared_directory in ${directories[@]}; do
fi
done

# optimize WSO2 Carbon Server, if the profile name is defined as an environment variable
if [[ ! -z "${PROFILE_NAME}" ]]
then
echo "Optimizing WSO2 Carbon Server" >&2
sh ${WSO2_SERVER_HOME}/bin/profileSetup.sh -Dprofile=${PROFILE_NAME}
fi

# copy any configuration changes mounted to config_volume
test -d ${config_volume} && [[ "$(ls -A ${config_volume})" ]] && cp -RL ${config_volume}/* ${WSO2_SERVER_HOME}/
# copy any artifact changes mounted to artifact_volume
test -d ${artifact_volume} && [[ "$(ls -A ${artifact_volume})" ]] && cp -RL ${artifact_volume}/* ${WSO2_SERVER_HOME}/

# copy any patches mounted to patch_volume
if [[ ! `test -d ${WSO2_SERVER_HOME}/updates/wum` ]]
then
test -d ${patch_volume} && [[ "$(ls -A ${patch_volume})" ]] \
&& echo "Copying critical patch fixes to GA pack" \
&& cp -RL ${patch_volume}/* ${WSO2_SERVER_HOME}/
fi

# start WSO2 Carbon server
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
echo "Start WSO2 Carbon server" >&2
if [[ -z "${PROFILE_NAME}" ]]
then
# start the server with the provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh "$@"
else
# start the server with the specified profile and provided startup arguments
sh ${WSO2_SERVER_HOME}/bin/wso2server.sh -Dprofile=${PROFILE_NAME} "$@"
fi

0 comments on commit 753e52e

Please sign in to comment.