summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDT Netsolution GmbH <[email protected]>2012-01-27 00:04:47 (GMT)
committer DT Netsolution GmbH <[email protected]>2012-01-27 00:04:47 (GMT)
commit9fb1cd3e0223fbc8d4c150085c453455f420cf4c (patch)
tree77c7f6f0e7d44708854ded4f9d45e63547ed8632 /bin
parent841784005c9db5b63a11acd0ee207a861d3cd52d (diff)
- moved builder frome itwatch to devtools
- restructured, added variable handling, callbacks, ....
Diffstat (limited to 'bin')
-rwxr-xr-xbin/builder.sh70
1 files changed, 70 insertions, 0 deletions
diff --git a/bin/builder.sh b/bin/builder.sh
new file mode 100755
index 0000000..3bc5b7a
--- /dev/null
+++ b/bin/builder.sh
@@ -0,0 +1,70 @@
+#!/bin/bash
+#
+#
+
+# enabled debug
+# set -x
+
+#####################
+# Controller
+####################
+builder_controller() {
+ local result
+
+ # read config
+ call_entry_point result config; (( $result == "0" )) || builder_config
+
+ # prepare
+ call_entry_point result prepare ; (( $result == "0" )) || builder_prepare
+
+ # download and process dist files
+ call_entry_point result retrieve; (( $result == "0" )) || builder_retrieve
+
+ # Create some special files
+ call_entry_point result create; (( $result == "0" )) || builder_create
+
+ # Start packaging
+ call_entry_point result package; (( $result == "0" )) || builder_package
+
+ # Upload to repos
+ call_entry_point result publish; (( $result == "0" )) || builder_publish
+
+ # git commit
+ call_entry_point result commit; (( $result == "0" )) || builder_commit
+
+ # cleanup
+ call_entry_point result cleanup; (( $result == "0" )) || builder_cleanup
+}
+
+####################
+# Main
+####################
+
+# get the 'real' directory this program stored in (resolve symbolic links)
+PRG=$(readlink -f $0)
+BASEDIR=`dirname "$PRG"`
+BASEDIR=`cd "$BASEDIR" && pwd`/..
+
+# Parameters
+PRODUCT_DIR=$1
+TARGET=$2
+
+# read libraries
+. $BASEDIR/lib/builder-targets.sh
+
+# check product directory
+if [ -z ${PRODUCT_DIR} ]; then PRODUCT_DIR="`pwd`" ; fi
+test -d $PRODUCT_DIR
+builder_check_error "no opsi product directory specified: $PRODUCT_DIR"
+
+# source additional, product dependent callback (cb) targets
+if [ -f "$PRODUCT_DIR/builder-targets-cb.sh" ] ; then
+ . "$PRODUCT_DIR/builder-targets-cb.sh"
+fi
+
+# call main
+builder_controller
+
+# exit
+exit 0
+

Powered by Domaintechnik.at | Hosting - Domain - Webspace