aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-06-11 09:49:59 +0300
committerValentin Popov <info@valentineus.link>2018-06-11 09:49:59 +0300
commitbb6684a6575bc373a3c12e2503db25f94653b2a7 (patch)
tree0459b68dc432c2af0bbcaf2ab3e56b343bfcf6c0
parent57452b8f579c68c50d2a807228f5ee0a8b711444 (diff)
downloadtool_apisiteadmins-bb6684a6575bc373a3c12e2503db25f94653b2a7.tar.xz
tool_apisiteadmins-bb6684a6575bc373a3c12e2503db25f94653b2a7.zip
Project build file
Signed-off-by: Valentin Popov <info@valentineus.link>
-rwxr-xr-xbuild.sh32
1 files changed, 32 insertions, 0 deletions
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