-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitCheckoutTag.sh
More file actions
executable file
·38 lines (33 loc) · 1.09 KB
/
gitCheckoutTag.sh
File metadata and controls
executable file
·38 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
githubBase="git@github.com:juliangruendner/"
mlServiceRepos=("ds_common" "ds_poll" "ds_queue" "ds_opal" "ds_test" "ds_poll_monitor_server" "ds_poll_monitor_gui" "ds_rstudio")
baseDir=$(pwd)
for repoName in ${mlServiceRepos[@]}
do
curRepo="$baseDir/$repoName"
cd $curRepo
if [[ $1 ]]; then
printf "tag $1 specified, switching to tag $1 for repo $curRepo for installation... \n"
branchInList=$(git branch | grep $1)
if [ "$branchInList" == "" ]; then
echo "reached inside for repo $curRepo"
git checkout tags/$1 -b $1
fi
git checkout $1
else
printf "switching to master as no tag specified for repo $curRepo for installation ... \n"
git checkout master
fi
done
cd $baseDir
if [[ $1 ]]; then
printf "tag $1 specified, switching to tag $1 for repo $curRepo for installation... \n"
branchInList=$(git branch | grep $1)
if [[ "$branchInList" == "" ]]; then
git checkout tags/$1 -b $1
fi
git checkout $1
else
printf "switching to master as no tag specified for repo $curRepo for installation ... \n"
git checkout master
fi