forked from cables-gl/cables_dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtag_repos.sh
More file actions
110 lines (100 loc) · 3.04 KB
/
tag_repos.sh
File metadata and controls
110 lines (100 loc) · 3.04 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/bash -l
#
# checks out repos at branch, updates, then tags them with the same tag
#
RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
WAIT=10
BASEDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
git fetch || true
set -e
set -o pipefail
echo -e ""
echo -e "${GREEN}TAGGING DEV...${NC}"
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
git tag "${1}"
git push origin tag "${1}"
echo -e ""
echo -e "${GREEN}TAGGING CORE...${NC}"
cd cables
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
git tag "${1}"
git push origin tag "${1}"
cd "$BASEDIR"
if [ -d cables_api ]; then
if [ -f cables_api/package.json ]; then
echo -e ""
echo -e "${GREEN}TAGGING API...${NC}"
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
cd cables_api
git tag "${1}"
git push origin tag "${1}"
fi
fi
cd "$BASEDIR"
echo -e ""
echo -e "${GREEN}TAGGING UI...${NC}"
cd cables_ui
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
git tag "${1}"
git push origin tag "${1}"
cd "$BASEDIR"
if [ -d cables_electron ]; then
echo -e ""
echo -e "${GREEN}TAGGING ELECTRON...${NC}"
cd cables_electron
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
git tag "${1}"
git push origin tag "${1}"
fi
cd "$BASEDIR"
echo -e ""
echo -e "${GREEN}TAGGING EXTENSIONS...${NC}"
OPSDIR=cables/src/ops/extensions/
if [ -d "$OPSDIR" ]; then
cd $OPSDIR
if [ -d ".git" ]; then
if [[ `git status --porcelain --untracked-files=no` ]]; then
echo -e "${RED}repository has local changes stash/commit before you tag...${NC}"
exit 1
fi
branch=`git rev-parse --abbrev-ref HEAD`
echo -e "${GREEN}tagging current state of '${branch}' with '${1}'...${NC}"
git tag "${1}"
git push origin tag "${1}"
else
echo -e "${RED} NOT A GIT REPO AT $OPSDIR, SKIPPING${NC}";
fi
else
echo -e "${RED}DIR NOT FOUND AT $OPSDIR, SKIPPING${NC}";
fi
cd "$BASEDIR"
echo -e ""
echo -e "${GREEN}DONE${NC}"