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

CLOUD-606 support injected /m2 repositories #123

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
58 changes: 31 additions & 27 deletions os-eap-s2i/added/s2i/assemble
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,37 @@ fi

LOCAL_SOURCE_DIR=/tmp/src

function copy_injected {
source_dir=$1
target_dir=$2

if [ -d "$source_dir" ]; then
cp -rf ${source_dir}/* $target_dir
fi
}

function handle_injected() {
if [ -n $CUSTOM_INSTALL_DIRECTORIES ]; then
IFS=',' read -a install_dir_entries <<< $CUSTOM_INSTALL_DIRECTORIES
for install_dir_entry in "${install_dir_entries[@]}"; do
for install_dir in $(find ${LOCAL_SOURCE_DIR}/$install_dir_entry -maxdepth 0 2>/dev/null); do
chmod -R 755 ${install_dir}
if [ -f ${install_dir}/install.sh ]; then
${install_dir}/install.sh ${install_dir}
else
copy_injected ${install_dir}/modules $JBOSS_HOME/modules

copy_injected ${install_dir}/configuration $JBOSS_HOME/standalone/configuration

copy_artifacts ${install_dir}/deployments war ear rar jar
fi
done
done
fi
}

handle_injected

# Resulting WAR files will be deployed to /opt/eap/standalone/deployments
DEPLOY_DIR=$JBOSS_HOME/standalone/deployments

Expand Down Expand Up @@ -103,33 +134,6 @@ if [ -d $LOCAL_SOURCE_DIR/modules ]; then
cp -vr $LOCAL_SOURCE_DIR/modules/* $JBOSS_HOME/modules/
fi

function copy_injected {
source_dir=$1
target_dir=$2

if [ -d "$source_dir" ]; then
cp -rf ${source_dir}/* $target_dir
fi
}

if [ -n $CUSTOM_INSTALL_DIRECTORIES ]; then
IFS=',' read -a install_dir_entries <<< $CUSTOM_INSTALL_DIRECTORIES
for install_dir_entry in "${install_dir_entries[@]}"; do
for install_dir in $(find ${LOCAL_SOURCE_DIR}/$install_dir_entry -maxdepth 0 2>/dev/null); do
chmod -R 755 ${install_dir}
if [ -f ${install_dir}/install.sh ]; then
${install_dir}/install.sh ${install_dir}
else
copy_injected ${install_dir}/modules $JBOSS_HOME/modules

copy_injected ${install_dir}/configuration $JBOSS_HOME/standalone/configuration

copy_artifacts ${install_dir}/deployments war ear rar jar
fi
done
done
fi

chmod -R g+rwX $HOME

# Remove java tmp perf data dir owned by 185
Expand Down