1996208e7549d2b257a861ac835955171f523766
[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
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_xsede()
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_xsede
51 }
52
53 # a shortcut for doing a new build and creating a bootstrap container with it.
54 function rebu_bootstrap()
55 {
56   rebuild_xsede 
57   if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi
58
59   bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh
60   if [ $? -ne 0 ]; then
61     echo "failed to bootstrap a container."
62     error_sound
63     return 1
64   fi
65
66   success_sound  
67 }
68
69 # a shortcut for building without a clean, and creating a bootstrap container with the code.
70 function bu_bootstrap()
71 {
72   build_xsede 
73   if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi
74
75   bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh
76   if [ $? -ne 0 ]; then
77     echo "failed to bootstrap a container."
78     error_sound
79     return 1
80   fi
81
82   success_sound  
83 }
84
85 # a shortcut for doing a quick build and then creating an installer.
86 function fast_install_build()
87 {
88   build_xsede 
89   if [ $? -ne 0 ]; then echo "failed to build xsede code"; return 1; fi
90
91   bash $GENII_INSTALL_DIR/xsede_tools/tools/installer/fast_installer_build.sh $*
92   if [ $? -ne 0 ]; then
93     echo "failed to bootstrap create the installer."
94     error_sound
95     return 1
96   fi
97
98   success_sound  
99 }
100
101