made spacem still show the rename if it was only case based. gffs refresher now...
[feisty_meow.git] / scripts / buildor / gffs_builders.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 define_yeti_alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred.  $msg"; return 1; fi'
7
8 function build_gffs()
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
16     error_sound
17     return 1
18   fi
19   echo "Build starting at: $(date)"
20
21   # clean up some things.
22   \rm -rf unit-test-reports
23
24   # build the trunk.
25   ant -Dbuild.targetArch=64 build
26   if [ $? -ne 0 ]; then
27     error_sound
28     return 1
29   fi
30   echo "Build done at: $(date)"
31   popd
32
33   success_sound  
34 }
35
36 function rebuild_gffs()
37 {
38   if [ -z "$GENII_INSTALL_DIR" ]; then
39     echo GENII_INSTALL_DIR is not set.
40     return 1
41   fi
42   pushd "$GENII_INSTALL_DIR"
43   ant clean
44
45   if [ $? -ne 0 ]; then
46     error_sound
47     return 1
48   fi
49   popd
50   build_gffs
51 }
52
53 # a shortcut for doing a new build and creating a bootstrap container with it.
54 function rebu_bootstrap()
55 {
56   rebuild_gffs 
57   if [ $? -ne 0 ]; then echo "failed to rebuild gffs code"; return 1; fi
58
59   quickstarter="$GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh"
60   if [ ! -f "$quickstarter" ]; then
61     quickstarter="$XSEDE_TEST_ROOT/library/bootstrap_quick_start.sh"
62   fi
63
64   bash "$quickstarter"
65   if [ $? -ne 0 ]; then
66     echo "failed to bootstrap a container."
67     error_sound
68     return 1
69   fi
70
71   success_sound  
72 }
73
74 # a shortcut for building without a clean, and creating a bootstrap container with the code.
75 function bu_bootstrap()
76 {
77   build_gffs 
78   if [ $? -ne 0 ]; then echo "failed to rebuild gffs code"; return 1; fi
79
80   quickstarter="$GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh"
81   if [ ! -f "$quickstarter" ]; then
82     quickstarter="$XSEDE_TEST_ROOT/library/bootstrap_quick_start.sh"
83   fi
84
85   bash "$quickstarter"
86   if [ $? -ne 0 ]; then
87     echo "failed to bootstrap a container."
88     error_sound
89     return 1
90   fi
91
92   success_sound  
93 }
94
95 # a shortcut for doing a quick build and then creating an installer.
96 function fast_install_build()
97 {
98   bash "$GENII_INSTALL_DIR/xsede_tools/tools/installer/fast_installer_build.sh" $*
99   if [ $? -ne 0 ]; then
100     echo "failed to create the installer."
101     error_sound
102     return 1
103   fi
104
105   success_sound  
106 }
107
108