Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

copy the plugins only if the plugins directory is empty in JENKINS_HOME #18

Merged
merged 1 commit into from
Mar 16, 2018
Merged
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
12 changes: 7 additions & 5 deletions 2/contrib/s2i/run
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if [ "${CONTAINER_MEMORY_IN_BYTES}" -lt "${DEFAULT_MEMORY_CEILING}" ]; then
if [ -z $CONTAINER_HEAP_PERCENT ]; then
CONTAINER_HEAP_PERCENT=0.50
fi

CONTAINER_MEMORY_IN_MB=$((${CONTAINER_MEMORY_IN_BYTES}/1024**2))
#if machine has 4GB or less, meaning max heap of 2GB given current default, force use of 32bit to save space unless user
#specifically want to force 64bit
Expand All @@ -54,7 +54,7 @@ if [ "${CONTAINER_MEMORY_IN_BYTES}" -lt "${DEFAULT_MEMORY_CEILING}" ]; then
echo "max heap in MB is ${CONTAINER_HEAP_MAX} and 64 bit was not explicitly set so using 32 bit Java"
alternatives --set java $JVMPath32bit
fi

JAVA_MAX_HEAP_PARAM="-Xmx${CONTAINER_HEAP_MAX}m"
if [ -z $CONTAINER_INITIAL_PERCENT ]; then
CONTAINER_INITIAL_PERCENT=0.07
Expand Down Expand Up @@ -149,9 +149,11 @@ fi

if [ "$(ls -A /opt/openshift/plugins 2>/dev/null)" ]; then
mkdir -p ${JENKINS_HOME}/plugins
echo "Copying $(ls /opt/openshift/plugins | wc -l) Jenkins plugins to ${JENKINS_HOME} ..."
cp -frL /opt/openshift/plugins/* ${JENKINS_HOME}/plugins/
rm -rf /opt/openshift/plugins
# if empty then only copy the plugins
if [ -z "$(ls -A ${JENKINS_HOME}/plugins)" ]; then
echo "Copying $(ls /opt/openshift/plugins | wc -l) Jenkins plugins to ${JENKINS_HOME} ..."
cp -frL /opt/openshift/plugins/* ${JENKINS_HOME}/plugins/
fi
fi

echo "Creating initial Jenkins 'admin' user ..."
Expand Down