forked from systematic/rails_templates
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun.exp
executable file
·130 lines (89 loc) · 2.34 KB
/
run.exp
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
#!/usr/bin/expect
# run without args, from your projects dir, you'll be prompted for stuff
# $ expect rails_templates/run.exp
# exp_internal 1
puts "running template"
puts ""
puts "project name: "
gets stdin project_name
puts ""
puts "mysql root password: "
stty -echo
gets stdin mysql_root_pw
stty echo
puts ""
puts "root password: "
stty -echo
gets stdin root_pw
stty echo
puts ""
puts "getexceptional api key: "
gets stdin getexceptional_api_key
set timeout -1
puts ""
spawn bash -c "rails_templates/run.rb $project_name; sleep 10; echo done"
puts ""
expect "gimme root sql password for db_setup: "
# sleep, otherwise pw gets echoed to stdout
sleep 1
send "$mysql_root_pw\r"
expect "Would you like to configure exceptional?"
send "y\r"
expect "exceptional key for application: "
send "$getexceptional_api_key\r"
expect "Would you like to add the common rails patches"
send "y\r"
expect "Compass recommends that you keep your stylesheets in app/stylesheets"
send "y\r"
expect "Compass recommends that you keep your compiled css in public/stylesheets/compiled/"
send "y\r"
expect "Would you like to install the Bootstrapper plugin?"
send "y\r"
expect "Would you like to run the web server config generator?"
send "y\r"
expect "Setup ghost entries for projects?"
send "y\r"
expect "Password:"
stty -echo
send "$root_pw\r"
stty echo
expect "Restart nginx"
send "y\r"
expect "Would you like to install the jruby testing stack?"
send "y\r"
expect "Would you like to install the user stack?"
send "y\r"
expect "Would you like to install the forgot password stack?"
send "y\r"
expect "Would you like to install the connection fix patch?"
send "y\r"
expect "Would you like to setup capistrano?"
send "y\r"
expect "Would you like to install the never forget multipart plugin?"
send "y\r"
expect "Would you like to install the fix you some address bar plugin?"
send "y\r"
expect "Would you like to add the pave and repave tasks?"
send "y\r"
expect "Would you like to have a pretty scaffold?"
send "y\r"
expect "Would you like to migrate the database?"
send "y\r"
expect "Would you like to deploy the app to heroku?"
send "n\r"
# sleep 8
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# expect -re $
# puts "$expect_out(buffer)"
puts ""
puts "done"