-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsynchub.sh
More file actions
executable file
·46 lines (38 loc) · 1.09 KB
/
Copy pathsynchub.sh
File metadata and controls
executable file
·46 lines (38 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
39
40
41
42
43
44
45
46
#! /bin/bash
#GIT_MIRROR_IP=192.168.122.20
#REMOTE_REPO_NAME=localMirror
GIT_MIRROR_IP=192.168.1.181
REMOTE_REPO_NAME=mirror
repoList="devstack horizon keystone python-keystoneclient glance python-glanceclient nova python-novaclient cinder python-cinderclient quantum python-quantumclient noVNC tempest swift python-openstackclient python-swiftclient python-ceilometerclient ceilometer heat python-heatclient"
GITHUB_DIR=/local/github
function checkStatus {
for repo in ${repoList};do
echo "${repo}"
cd ${GITHUB_DIR}/${repo}
git st
done
}
function mirrorCfg {
for repo in ${repoList};do
cat << DONE_${repo}
repo ${repo}
RW+ = @all
R = daemon
${repo} "Owner" = "Test repo"
DONE_${repo}
done
}
function syncMirror {
for repo in ${repoList};do
echo "${repo}"
cd ${GITHUB_DIR}/${repo}
git co master
git remote add ${REMOTE_REPO_NAME} gitolite@${GIT_MIRROR_IP}:${repo}.git
git st
git pull
git push ${REMOTE_REPO_NAME} master
done
}
checkStatus
mirrorCfg
syncMirror