diff --git a/build_installation_package.sh b/build_installation_package.sh index e07851c..3c9877a 100644 --- a/build_installation_package.sh +++ b/build_installation_package.sh @@ -1,11 +1,24 @@ #!/bin/bash -# Script for creating a single compressed archive, after download_dependencies.sh +# Script for creating a single compressed deployment archive, once download_dependencies.sh # has been executed. -# It will create an archive in the $TARGET_DIRECTORY, named $ARCHIVE_NAME. +# It will create an archive named $ARCHIVE_NAME using the files in $SOURCE_DIRECTORY, +# stored in $TARGET_DIRECTORY. +set -ex + +SOURCE_DIRECTORY="." TARGET_DIRECTORY="/tmp/dqmgui" ARCHIVE_NAME="dqmgui_installation_package.tar.gz" +# Parse command line arguments -- use = to override the flags mentioned above. +# e.g. ARCHIVE_NAME="test.tar.gz" +for ARGUMENT in "$@"; do + KEY=$(echo "$ARGUMENT" | cut -f1 -d=) + KEY_LENGTH=${#KEY} + VALUE="${ARGUMENT:$KEY_LENGTH+1}" + eval "$KEY=$VALUE" +done + mkdir -p "$TARGET_DIRECTORY" -tar --exclude "./git" --exclude "./github" -cf "$TARGET_DIRECTORY/$ARCHIVE_NAME" . -I "gzip --best" +tar --exclude "./git" --exclude "./github" -cf "$TARGET_DIRECTORY/$ARCHIVE_NAME" "$SOURCE_DIRECTORY" -I "gzip --best"