Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add functionality for reteiving docker build files
pcaskey committed Nov 3, 2017
1 parent c0e5c9b commit 2675135
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions configBuilder.sh
@@ -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
@@ -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

@@ -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

0 comments on commit 2675135

Please sign in to comment.