806d8ad7e8ac338584d01ab18e23d0bf725cb88f
[feisty_meow.git] / scripts / buildor / build_xsedes.sh
1 #!/bin/bash
2
3 source "$FEISTY_MEOW_SCRIPTS/core/functions.sh"
4
5 #hmmm: if this works well, we can use it in lots of places.
6 alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred.  $msg"; return 1; fi'
7
8 function build_xsede()
9 {
10   if [ -z "$GENII_INSTALL_DIR" ]; then
11     echo GENII_INSTALL_DIR is not set.
12     return 1
13   fi
14   pushd $GENII_INSTALL_DIR
15   if [ $? -ne 0 ]; then return 1; fi
16   echo "Build starting at: $(date)"
17
18   # clean up some things.
19   \rm -rf unit-test-reports
20
21   # build the trunk.
22   ant -Dbuild.targetArch=64 build
23   if [ $? -ne 0 ]; then return 1; fi
24   echo "Build done at: $(date)"
25   popd
26
27   success_sound  
28 }
29
30 function rebuild_xsede()
31 {
32   if [ -z "$GENII_INSTALL_DIR" ]; then
33     echo GENII_INSTALL_DIR is not set.
34     return 1
35   fi
36   pushd $GENII_INSTALL_DIR
37   ant clean
38
39   if [ $? -ne 0 ]; then return 1; fi
40   popd
41   build_xsede
42 }
43
44 # a shortcut for doing a new build and creating a bootstrap container with it.
45 function rebu_bootstrap()
46 {
47   rebuild_xsede 
48   if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi
49
50   bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh
51   if [ $? -ne 0 ]; then echo "failed to bootstrap a container"; return 1; fi
52
53   success_sound  
54 }
55
56 # a shortcut for building without a clean, and creating a bootstrap container with the code.
57 function bu_bootstrap()
58 {
59   build_xsede 
60   if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi
61
62   bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh
63   if [ $? -ne 0 ]; then echo "failed to bootstrap a container"; return 1; fi
64
65   success_sound  
66 }
67
68 # a shortcut for doing a quick build and then creating an installer.
69 function fast_install_build()
70 {
71   build_xsede 
72   if [ $? -ne 0 ]; then echo "failed to build xsede code"; return 1; fi
73
74   bash $GENII_INSTALL_DIR/xsede_tools/tools/installer/fast_installer_build.sh $*
75   if [ $? -ne 0 ]; then echo "failed to create the installer."; return 1; fi
76
77   success_sound  
78 }
79
80