Should check for .git/config in each project
[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         echo "$0: Processing '${project}',mode='$1' ..."
21         cd "${JPROJECTS_HOME}/${project}" || exit 255
22
23         SKIP_TEST="${project:0:9}"
24
25         if [ -z "$2" -o "${SKIP_TEST}" = "jratecalc" ]
26         then
27                 echo "$0: Pushing '${project}',mode='$1' ..."
28                 git push --all || exit 255
29         fi
30
31         if [ "${SKIP_TEST}" = "jratecalc" ]
32         then
33                 echo "$0: Not continuing for jratecalc project '${project}'."
34                 continue
35         elif [ "$1" = "d" ]
36         then
37                 git push --all daedalus
38         elif [ "$1" = "t" ]
39         then
40                 git push --all transport
41         elif [ "$1" = "u" ]
42         then
43                 git push --all upstream
44         fi
45
46         cd "${JPROJECTS_HOME}"
47 done