-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgit-create-project.sh
executable file
·140 lines (109 loc) · 3.33 KB
/
git-create-project.sh
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/bash
function wait_for_pid_to_disappear() {
while [ ! -z "`ps -p ${1} -o cmd --no-headers`" ]; do
sleep 1
done
}
function usage()
{
echo "Usage:"
echo " feature-name"
echo " use-git-protocol"
}
PROJECT=$1
if [ -z "${PROJECT}" ]; then
usage
exit 1
fi
PROTOCOL="https://github.com/"
if [ -n "${2}" ]; then
PROTOCOL="[email protected]:"
fi
if [ -d "./${PROJECT}" ]; then
echo "Project ./${PROJECT} already exists. Aborting"
exit 1
else
echo "Project ./${PROJECT} does not exist. Proceeding"
fi
ORIG_PWD=${PWD}
if [ ! -d "boost_1_59_0" ]; then
echo "Requires boost_1_59_0 be present in ${PWD}"
exit 1
fi
if [ ! -d "boost_1_66_0" ]; then
echo "Requires boost_1_66_0 be present in ${PWD}"
exit 1
fi
mkdir ./${PROJECT}
cd ./${PROJECT}
ln -s ../boost_1_59_0
ln -s ../boost_1_65_0
ln -s ../boost_1_66_0
ln -s ../boost_1_67_0
ln -s ../boost_1_68_0
ln -s ../boost_1_69_0
ln -s ../boost_1_70_0
unset pids;
pid_idx=1
git clone --recursive ${PROTOCOL}georgelorchpercona/myrocks &
pids[${pid_idx}]=$!
pid_idx=`expr ${pid_idx} + 1`
git clone --recursive ${PROTOCOL}percona/percona-server -b 5.6 percona-server-5.6 &
pids[${pid_idx}]=$!
pid_idx=`expr ${pid_idx} + 1`
git clone --recursive ${PROTOCOL}percona/percona-server -b 5.7 percona-server-5.7 &
pids[${pid_idx}]=$!
pid_idx=`expr ${pid_idx} + 1`
git clone --recursive ${PROTOCOL}percona/percona-server -b 8.0 percona-server-8.0 &
pids[${pid_idx}]=$!
pid_idx=`expr ${pid_idx} + 1`
git clone --recursive https://github.com/facebook/mysql-5.6 facebook-mysql &
pids[${pid_idx}]=$!
pid_idx=`expr ${pid_idx} + 1`
mkdir percona-server-build-5.6
mkdir percona-server-install-5.6
mkdir percona-server-build-5.7
mkdir percona-server-install-5.7
mkdir percona-server-build-8.0
mkdir percona-server-install-8.0
mkdir facebook-mysql-build
mkdir facebook-mysql-install
for ((i=1; i<${pid_idx}; i++)); do
wait_for_pid_to_disappear ${pids[${i}]}
done
unset pids
unset pid_idx
cd ../${PROJECT}/percona-server-5.6
git remote add downstream ${PROTOCOL}georgelorchpercona/percona-server
git remote add local-5.7 ../percona-server-5.7
git remote add local-8.0 ../percona-server-8.0
git remote add local-fb ../facebook-mysql
cd -
cd ../${PROJECT}/percona-server-5.7
git remote add downstream ${PROTOCOL}georgelorchpercona/percona-server
git remote add local-5.6 ../percona-server-5.6
git remote add local-8.0 ../percona-server-8.0
git remote add local-fb ../facebook-mysql
cd -
cd ../${PROJECT}/percona-server-8.0
git remote add downstream ${PROTOCOL}georgelorchpercona/percona-server
git remote add local-5.6 ../percona-server-5.6
git remote add local-5.7 ../percona-server-5.7
git remote add local-fb ../facebook-mysql
cd -
cd ../${PROJECT}/percona-server-5.6/storage/tokudb/PerconaFT
git remote add downstream ${PROTOCOL}georgelorchpercona/PerconaFT
cd -
cd ../${PROJECT}/percona-server-5.7/storage/tokudb/PerconaFT
git remote add downstream ${PROTOCOL}georgelorchpercona/PerconaFT
cd -
cd ../${PROJECT}/percona-server-8.0/storage/tokudb/PerconaFT
git remote add downstream ${PROTOCOL}georgelorchpercona/PerconaFT
cd -
cd ../${PROJECT}/facebook-mysql
git remote add downstream ${PROTOCOL}georgelorchpercona/mysql-5.6
git remote add local-5.6 ../percona-server-5.6
git remote add local-5.7 ../percona-server-5.7
git remote add local-8.0 ../percona-server-8.0
cd -
cd ${ORIG_PWD}