Removed jcontacts-ejb as this is to generic and needs to be project-dependent.
[jprojects-scripts.git] / push-stick.sh
1 #!/bin/bash
2
3 . ./.jprojects.sh || exit 255
4
5 TARGETS="d t u"
6
7 if [ "$1" = "a" ]
8 then
9         cd "${JPROJECTS_HOME}"
10         for TARGET in ${TARGETS}; do
11                 echo "$0: Pushing for target '${TARGET}' ..."
12                 $0 "${TARGET}" "1"
13         done
14
15         echo "$0: Pushed to all targets."
16         exit 0
17 fi
18
19 for project in ${LIST}; do
20         if [ ! -d "${JPROJECTS_HOME}/${project}" ]
21         then
22                 echo "$0: Project '${project}' does not exist."
23                 continue;
24         fi
25
26         echo "$0: Processing '${project}',mode='$1' ..."
27         cd "${JPROJECTS_HOME}/${project}" || exit 255
28
29         SKIP_TEST="${project:0:9}"
30
31         if [ -z "$2" -o "${SKIP_TEST}" = "jratecalc" ]
32         then
33                 echo "$0: Pushing '${project}',mode='$1' ..."
34                 git push --all || exit 255
35         fi
36
37         if [ "${SKIP_TEST}" = "jratecalc" ]
38         then
39                 echo "$0: Not continuing for jratecalc project '${project}'."
40                 continue
41         elif [ "$1" = "d" ]
42         then
43                 git push --all daedalus || exit 255
44         elif [ "$1" = "t" ]
45         then
46                 git push --all transport || exit 255
47         elif [ "$1" = "u" ]
48         then
49                 git push --all upstream || exit 255
50         fi
51
52         cd "${JPROJECTS_HOME}"
53 done