summaryrefslogtreecommitdiff
path: root/test/create_testbed.sh
blob: 42fc0a7210b1ce845e8791106e0098b6f2aeeaa7 (plain)
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
#!/bin/sh
##
## This script is part of the scorsh testbed. It must be executed by
## the scorsh_testsuite script
##

. ./scorsh_functions

### remove the directories if they exist already
[ -d ${REMOTE_REPO} ] && rm -rf ${REMOTE_REPO}
[ -d ${LOCAL_REPO} ] && rm -rf ${LOCAL_REPO}

### create the repository 
git init --bare ${REMOTE_REPO}
check "[ $? -eq 0 ]" $0 "create_remote_repo"

### clone it
git clone ${REMOTE_REPO} ${LOCAL_REPO}
check "[ $? -eq 0 ]" $0 "clone_remote_repo"





### create the directory where scorsh will be cloned
mkdir ${SCORSH_REPO}
check "[ $? -eq 0 ]" $0 "create_scorsh_repo_folder"

### clone the scorsh repo
olddir=$(pwd)
cd ${SCORSH_REPO}
git clone ${SCORSH_URL} ./
check "[ $? -eq 0 ]" $0 "clone_scorsh_repo"
cd ${olddir}

### make the scorshd executable
olddir=$(pwd)
cd ${SCORSH_REPO}
make
check "[ $? -eq 0 ]" $0 "make_scorshd"
cd ${olddir}


### create the directory where the scorsh app will run
mkdir ${SCORSH_APP}
check "[ $? -eq 0 ]" $0 "create_scorsh_app_folder"


### create spool directory
mkdir "${SCORSH_APP}/spool"
check "[ -$? -eq 0 ]" $0 "create_spool_folder"


### configure the remote to be used with scorsh
cd ${REMOTE_REPO}
git config -f scorsh scorsh.spooldir $(realpath "${SCORSH_APP}/spool")
check "[ $? -eq 0 ]" $0 "config_remote_repo"
cd -


return_results