Skip to content
Permalink
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (30 sloc) 1.02 KB
#!/bin/bash
set -e
##########. WARNING. #################
## This is a hack. plain and simple.
## Do not try this at home.
######################################
PACKAGES_DIR=/var/vcap/packages
JOB_DIR=/var/vcap/jobs/uaa-customized
# Wait until UAA pre-start has finished copying files from packages to avoid
# race condition between pre-start scripts
until [ -d /var/vcap/data/uaa/ ]; do
sleep 1
done
sleep 5
# Allow for > 128bit encryption
cp -a "${PACKAGES_DIR}"/jce-policy/UnlimitedJCEPolicyJDK8/*.jar "${PACKAGES_DIR}/uaa/jdk/jre/lib/security"
WARFILE="${PACKAGES_DIR}/uaa/tomcat/webapps/ROOT.war"
JARFILE=$(unzip -v "${WARFILE}" | grep cloudfoundry-identity-server- | awk '{print $8}')
WAR_TEMPDIR="$(mktemp -d)"
pushd "${WAR_TEMPDIR}"
unzip "${WARFILE}" "${JARFILE}"
mkdir -p templates/web
cp -a "${JOB_DIR}"/web/* templates/web
zip -r "${JARFILE}" templates/web
zip "$WARFILE" "$JARFILE"
mkdir resources
cp -a "${JOB_DIR}"/resources/* resources/
zip -r "${WARFILE}" resources
popd
rm -rf "${WAR_TEMPDIR}"
You can’t perform that action at this time.