-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_environment
executable file
·62 lines (53 loc) · 1.2 KB
/
init_environment
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
#!/bin/bash
# init test environment
mkdir test_environment
cd test_environment
# create test repos
mkdir repo_1.git
cd repo_1.git
git --bare init
cd ..
mkdir repo_2.git
cd repo_2.git
git --bare init
cd ..
# create model repo
mkdir repo_models.git
cd repo_models.git
git --bare init
cd ..
# provide initial commit
git clone file://`pwd`/repo_1.git
cd repo_1
git commit --allow-empty -m"initial commit
Transaction-Id: 1"
git remote add origin file://`pwd`/repo_1.git
git push origin master
cd ..
rm -rf repo_1
git clone file://`pwd`/repo_2.git
cd repo_2
git commit --allow-empty -m"initial commit
Transaction-Id: 1"
git remote add origin file://`pwd`/repo_2.git
git push origin master
cd ..
rm -rf repo_2
git clone file://`pwd`/repo_models.git
cd repo_models
git commit --allow-empty -m"initial commit
Transaction-Id: 1"
git remote add origin file://`pwd`/repo_models.git
git push origin master
cd ..
rm -rf repo_models
# add post-commit repos
cp ../pre-receive repo_1.git/hooks/
chmod +x repo_1.git/hooks/pre-receive
cp ../pre-receive repo_2.git/hooks/
chmod +x repo_2.git/hooks/pre-receive
cp ../pre-receive repo_models.git/hooks/
chmod +x repo_models.git/hooks/pre-receive
# exit test environment
cd ..
ruby server.rb &