From bb6684a6575bc373a3c12e2503db25f94653b2a7 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 11 Jun 2018 10:49:59 +0400 Subject: Project build file Signed-off-by: Valentin Popov --- build.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..fcd294f --- /dev/null +++ b/build.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# Author: Valentin Popov +# Email: info@valentineus.link +# Date: 2018-06-11 +# Usage: /bin/sh ./build.sh +# Description: Build the final package for installation in Moodle. + +# Updating the Environment +PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" +export PATH="$PATH:/usr/local/scripts" + +# Current project +PROJECT="tool_apisiteadmins" + +# Defining directories +DIRECTORY="$(pwd)" +NAMEDIR="$(basename $DIRECTORY)" +TMPDIR="$(mktemp --directory)" + +# Creating a Temporary Directory +cp --recursive --verbose "../$NAMEDIR" "$TMPDIR/$PROJECT" +mkdir --parents --verbose "$DIRECTORY/build" +cd "$TMPDIR" + +# Creating an archive +zip -9 -r "$DIRECTORY/build/$PROJECT.zip" "$PROJECT" \ + -x "$PROJECT/.git*" \ + -x "$PROJECT/.travis.yml" \ + -x "$PROJECT/build*" + +# End of work +exit 0 -- cgit v1.2.3