Skip to content

add functionality for reteiving docker build files #14

Merged
merged 1 commit into from Nov 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 40 additions & 6 deletions configBuilder.sh
Expand Up @@ -8,9 +8,13 @@ cd /scriptrun

# script config items
SHB_CFG_URL=https://github.internet2.edu/docker/shib-idp-conftree/archive/3.3release.zip
TOM_CFG_URL=https://github.internet2.edu/docker/shib-idp-tomcat-config/archive/master.zip
TOM_CFG_URL=https://github.intrnet2.edu/docker/shib-idp-tomcat-config/archive/master.zip
TMP_DIR_S=/tmp/3.3release
TMP_DIR_T=/tmp/tomcfg
TMP_DIR_D=/tmp/buildfiles
LINUX_BUILD_FILES_URL=https://github.internet2.edu/docker/shib-idp_noVM/archive/master.zip
WINDOWS_BUILD_FILES_URL=https://github.internet2.edu/docker/ShibbIdP_noVM_Windows/archive/master.zip


# default directories
TOMCFG=config/tomcat
Expand Down Expand Up @@ -56,16 +60,44 @@ mkdir -p config/shib-idp/messages
mkdir -p config/shib-idp/metadata
mkdir -p logs/shib-idp

#grab copy of Dockerfile (from host filesystem mount)

###########################################################
### grab the docker build files, depending on OS choice ###
###########################################################
# first, check for wget
command -v wget >/dev/null 2>&1 || { echo >&2 "ERROR: wget is required, but doesn't appear to be installed. Aborting..."; exit 1; }


case "$BUILD_ENV" in
LINUX | linux)
echo "Getting build files for a Linux container"
wget -q -O ${TMP_DIR_D}.zip ${LINUX_BUILD_FILES_URL} > /dev/null
;;
WINDOWS | windows)
echo "Getting build files for a Windows container"
wget -q -O ${TMP_DIR_D}.zip ${WINDOWS_BUILD_FILES_URL} > /dev/null
;;
*)
echo "Environment variable BUILD_ENV was not found or had an incorrect value (only LINUX|WINDOWS is supported). Terminating."
exit 1
;;
esac

unzip -o -d ${TMP_DIR_D} ${TMP_DIR_D}.zip > /dev/null 2>&1

cp -rf ${TMP_DIR_D}/* /output
rm -f /output/configBuilder.sh > /dev/null 2>&1
rm -f /output/setup.log > /dev/null 2>&1

#grab copy of Dockerfile in working dir
cp -f /output/Dockerfile .



##############################################################
### download default/TIER config for both shibb and tomcat ###
##############################################################
#
# first, check for wget
command -v wget >/dev/null 2>&1 || { echo >&2 "ERROR: wget is required, but doesn't appear to be installed. Aborting..."; exit 1; }

wget -q -O ${TMP_DIR_S}.zip ${SHB_CFG_URL} > /dev/null
wget -q -O ${TMP_DIR_T}.zip ${TOM_CFG_URL} > /dev/null

Expand Down Expand Up @@ -680,7 +712,9 @@ rm -f ${TMP_DIR_T}.zip
rm -rf ${TMP_DIR_T}/*
rmdir ${TMP_DIR_T}


rm -f ${TMP_DIR_D}.zip
rm -rf ${TMP_DIR_D}/*
rmdir ${TMP_DIR_D}


#copy config to output directory
Expand Down