forked from srushti/goldberg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·87 lines (71 loc) · 1.72 KB
/
install.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
success_message() {
printf "
Goldberg installation successful.
To add a repository to Goldberg, use the following command:
cd goldberg; bin/goldberg add <git url> <name>
To start goldberg:
cd goldberg; bin/goldberg start [port=3000]
Feel free to send us your questions or feedback at [email protected]
"
}
check_rvm() {
echo -ne "Checking rvm.. "
type -P rvm &>/dev/null || {
echo -ne "not available."
echo "rvm is not not installed. Please retry after installing rvm. (https://rvm.beginrescueend.com/rvm/install/)" >&2;
exit 1;
}
echo "present."
}
check_git() {
echo -ne "Checking git.. "
type -P git &>/dev/null || {
echo -ne "not available."
echo "git is not not installed. Please retry after installing git. (http://book.git-scm.com/2_installing_git.html)" >&2;
exit 1;
}
echo "present."
}
check_ruby() {
echo -ne "Checking ruby.. "
type -P ruby &>/dev/null || {
echo -ne "not available."
echo "Ruby not installed."
rvm install ruby-1.9.2-p180
rvm use ruby-1.9.2-p180
}
echo "present."
}
check_bundler() {
echo -ne "Checking bundler.. "
type -P bundle &>/dev/null || {
echo -ne "not available."
echo "Bundler not installed."
gem install bundler rake
}
echo "present."
}
yes_or_no() {
echo -n "$1 (y/n) "
read ans
case "$ans" in
y|Y|yes|YES|Yes) return 0 ;;
*) echo Exiting; return 1 ;;
esac
}
install_goldberg() {
git clone git://github.com/c42/goldberg.git
cd goldberg
rake db:create db:migrate
}
#----------------------------------------------------
printf "
-- Goldberg CI Server Installation (beta)
"
yes_or_no "This will install Goldberg in `pwd`/goldberg. Continue? " || exit 1;
check_rvm
check_ruby
check_git
install_goldberg
success_message
exit 0;