summaryrefslogtreecommitdiffstats
path: root/build/gmc-build.sh
diff options
context:
space:
mode:
authorShireesh Anjal <anjalshireesh@gmail.com>2011-03-28 07:06:52 -0700
committerShireesh Anjal <anjalshireesh@gmail.com>2011-03-28 07:06:52 -0700
commit1e52663c438d88cf3b2dd8bfcd8037f69a011cd3 (patch)
tree4287e0517a5798a76c6ad724eb14262a8329d1a2 /build/gmc-build.sh
parent24363b3a303c9efb8c3c93643cf09cad91c0c74a (diff)
parent138f6ba71c200d85eedcc6acbfdee50688e1e8e9 (diff)
Merge ../gmc-build
Diffstat (limited to 'build/gmc-build.sh')
-rwxr-xr-xbuild/gmc-build.sh111
1 files changed, 111 insertions, 0 deletions
diff --git a/build/gmc-build.sh b/build/gmc-build.sh
new file mode 100755
index 00000000..4a9b1982
--- /dev/null
+++ b/build/gmc-build.sh
@@ -0,0 +1,111 @@
+USAGE_ERR=1
+
+BUILD_DIR=/tmp/buckminster/glustermc
+BUCKMINSTER_URL=http://download.eclipse.org/tools/buckminster/headless-3.6/
+TARGET_PLATFORM_URL=/data/private/gmc-target.git
+SRC_URL=/data/private/gmc-src.git
+
+BUCKMINSTER_PRODUCT_NAME=org.eclipse.buckminster.cmdline.product
+MAIN_FEATURE=com.gluster.storage.management.gui.feature.webstart
+
+TYPE_ALL="a"
+TYPE_SETUP="s"
+TYPE_BUILD="b"
+
+startBold() {
+ tput bold
+}
+
+stopBold() {
+ tput sgr0
+}
+
+# Shows given text in bold
+showBold() {
+ startBold
+ echo ${1}
+ stopBold
+}
+
+# Get the director that can be used to install headless buckminster
+get_director()
+{
+ echo "Downloading `startBold`director`stopBold`..."
+ wget http://ftp.daum.net/eclipse//tools/buckminster/products/director_latest.zip
+ echo "Installing director..."
+ unzip director_latest.zip
+}
+
+install_buckminster()
+{
+ echo "Installing `startBold`Buckminster`stopBold`..."
+ cd director
+ ./director -r ${BUCKMINSTER_URL} -d ${BUCKMINSTER_HOME} -p Buckminster -i ${BUCKMINSTER_PRODUCT_NAME}
+
+ echo "Setting up Buckminster..."
+ cd ${BUCKMINSTER_HOME}
+ ./buckminster install ${BUCKMINSTER_URL} org.eclipse.buckminster.core.headless.feature
+ ./buckminster install ${BUCKMINSTER_URL} org.eclipse.buckminster.pde.headless.feature
+ ./buckminster install ${BUCKMINSTER_URL} org.eclipse.buckminster.git.headless.feature
+ ./buckminster install ${BUCKMINSTER_URL} org.eclipse.buckminster.emma.headless.feature
+}
+
+configure_workspace()
+{
+ echo "Configuring the workspace..."
+ cd ${WORKSPACE_DIR}
+ rm -rf *
+ git clone ${TARGET_PLATFORM_URL}
+ git clone ${SRC_URL}
+
+ echo "Importing target platform..."
+ ../buckminster importtarget --active gmc-src/com.gluster.storage.management.releng/gluster-management-console.target
+ echo "Importing component query for glustermc..."
+ ../buckminster import gmc-src/com.gluster.storage.management.releng/com.gluster.storage.management.gui.feature.webstart.cquery
+ cd -
+}
+
+build()
+{
+ echo "Cleaning build directory..."
+ rm -rf ${BUILD_DIR}/*
+
+ echo "Exporting the product..."
+ ./buckminster perform --properties ${PROPERTIES_FILE} ${MAIN_FEATURE}#create.eclipse.jnlp.product
+ ./buckminster perform --properties ${PROPERTIES_FILE} ${MAIN_FEATURE}#copy.root.files
+
+ # buckminster signs the jars using eclipse certificate - hence unsign and sign them again
+ echo "Signing product jars..."
+ ./buckminster perform --properties ${PROPERTIES_FILE} ${MAIN_FEATURE}#unsign.jars
+ ./buckminster perform --properties ${PROPERTIES_FILE} ${MAIN_FEATURE}#sign.jars
+}
+
+#-----------------------------------
+# Main Action Body
+#-----------------------------------
+
+echo
+if [ $# -ne 2 ]; then
+ echo "Usage: ${0} <build-type> <build-directory>"
+ echo "build-type value can be one of:"
+ echo " `startBold` ${TYPE_ALL}`stopBold` - Sets up the build directoryand then triggers a full build"
+ echo " `startBold` ${TYPE_SETUP}`stopBold` - Sets up the build directory; doesn't trigger build"
+ echo " `startBold` ${TYPE_BUILD}`stopBold` - Assumes that build directory is set up and simply triggers the build"
+ echo
+ exit ${USAGE_ERR}
+fi
+
+BUILD_MODE=${1}
+BUCKMINSTER_HOME=${2}
+WORKSPACE_DIR=${BUCKMINSTER_HOME}/workspace
+PROPERTIES_FILE=${WORKSPACE_DIR}/gmc-src/com.gluster.storage.management.releng/glustermc_build.properties
+
+if [ "${BUILD_MODE}" == "${TYPE_ALL}" -o "${BUILD_MODE}" == "${TYPE_SETUP}" ]; then
+ get_director
+ install_buckminster
+fi
+
+if [ "${BUILD_MODE}" == "${TYPE_ALL}" -o "${BUILD_MODE}" == "${TYPE_BUILD}" ]; then
+ configure_workspace
+ build
+fi