railsmachine-railsmachine 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.textile +133 -32
- data/lib/railsmachine/generators/railsmachine/templates/deploy.rb +1 -1
- data/lib/railsmachine/recipes.rb +36 -6
- data/lib/railsmachine/recipes/app/deploy.rb +3 -4
- data/lib/railsmachine/recipes/app/mongrel.rb +0 -15
- data/lib/railsmachine/recipes/app/passenger.rb +1 -2
- data/lib/railsmachine/recipes/web/apache.rb +0 -16
- metadata +2 -2
data/README.textile
CHANGED
|
@@ -1,32 +1,133 @@
|
|
|
1
|
-
h1.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<code>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
h1. Five Minute Rails Application Deployment
|
|
2
|
+
|
|
3
|
+
Ready to deploy your Rails application to "Rails Machine":http://railsmachine.com/? Follow these steps and you'll have it running in no time! Feel free to utilize Rails Machine's Ask Us Anything Support and "contact us with any questions you have along the way":https://support.railsmachine.com/index.php?pg=request.
|
|
4
|
+
|
|
5
|
+
h2. Update Gems
|
|
6
|
+
|
|
7
|
+
Install the latest version of the "railsmachine gem":http://github.com/railsmachine/railsmachine:
|
|
8
|
+
|
|
9
|
+
<pre>
|
|
10
|
+
<code>
|
|
11
|
+
$ sudo gem install railsmachine
|
|
12
|
+
</code>
|
|
13
|
+
</pre>
|
|
14
|
+
|
|
15
|
+
h2. Install Phusion Passenger and Ruby Enterprise Edition
|
|
16
|
+
|
|
17
|
+
If you do not have Phusion Passenger and Ruby Enterprise Edition installed on your Rails Machine yet you can run this installer on your server.
|
|
18
|
+
|
|
19
|
+
<pre>
|
|
20
|
+
<code>
|
|
21
|
+
$ wget http://assets.railsmachine.com/wiki/centos_passenger_install.sh
|
|
22
|
+
$ sh centos_passenger_install.sh
|
|
23
|
+
</code>
|
|
24
|
+
</pre>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
h2. Setup Capistrano
|
|
28
|
+
|
|
29
|
+
Capify your application:
|
|
30
|
+
|
|
31
|
+
<pre>
|
|
32
|
+
<code>
|
|
33
|
+
$ capify .
|
|
34
|
+
</code>
|
|
35
|
+
</pre>
|
|
36
|
+
|
|
37
|
+
h2. Configure Capistrano for Rails Machine
|
|
38
|
+
|
|
39
|
+
The following step customizes your @config/deploy.rb@ with two bits of information you provide:
|
|
40
|
+
|
|
41
|
+
* *@--name@*: a simple name for your application. no spaces, please.
|
|
42
|
+
** example: my-cool-app
|
|
43
|
+
* *@--domain@*: the primary domain name for your application. please omit the 'www' - we automaticaly alias www.whateveryouprovide.com as needed.
|
|
44
|
+
** example: my-cool-app.com
|
|
45
|
+
|
|
46
|
+
<pre>
|
|
47
|
+
<code>
|
|
48
|
+
$ railsmachine --apply-to . --name my-cool-app --domain my-cool-app.com
|
|
49
|
+
</code>
|
|
50
|
+
</pre>
|
|
51
|
+
|
|
52
|
+
Please note that the domain name provided will need to be correctly pointed at your Rails Machine account. If you don't have a DNS provider, we've been more than happy with "DNS Made Easy":http://dnsmadeeasy.com.
|
|
53
|
+
|
|
54
|
+
h2. Update Database Config
|
|
55
|
+
|
|
56
|
+
Update your applications @config/database.yml@'s section with your desired MySQL datbase name, username, and password. The database and user will be created for you in a forthcoming step.
|
|
57
|
+
|
|
58
|
+
h2. Application Setup
|
|
59
|
+
|
|
60
|
+
Rails Machine defaults to using mongrel + mod_proxy_balancer to run your Rails Application. If you'd like to switch to "Phusion Passenger":http://www.modrails.com/, edit the line in your application's @config/deploy.rb@ that begins @set :app_server@ to reflect your choice. For example:
|
|
61
|
+
|
|
62
|
+
<pre>
|
|
63
|
+
<code>
|
|
64
|
+
set :app_server, :passenger
|
|
65
|
+
</code>
|
|
66
|
+
</pre>
|
|
67
|
+
|
|
68
|
+
Run the following Capistrano task to setup your MySQL databases and configure your application servers (mongrel/passenger):
|
|
69
|
+
|
|
70
|
+
<pre>
|
|
71
|
+
<code>
|
|
72
|
+
$ cap servers:setup
|
|
73
|
+
</code>
|
|
74
|
+
</pre>
|
|
75
|
+
|
|
76
|
+
h2. Source Control
|
|
77
|
+
|
|
78
|
+
h3. If you're already using Source Control...
|
|
79
|
+
|
|
80
|
+
...edit the lines in your application's @config/deploy.rb@ that begin @set :repository@ and @set :repository@. For example:
|
|
81
|
+
|
|
82
|
+
<pre>
|
|
83
|
+
<code>
|
|
84
|
+
set :scm, :git
|
|
85
|
+
set :repository, "git@github.com:yourname/my-cool-app.git"
|
|
86
|
+
</code>
|
|
87
|
+
</pre>
|
|
88
|
+
|
|
89
|
+
h3. If you're not yet using Source Control...
|
|
90
|
+
|
|
91
|
+
...you can easily setup a Git/Subversion repository on your Rails Machine. Subversion is the default, edit the line in your application's @config/deploy.rb@ that begins @set :scm@ if you'd like to change it to git. For example:
|
|
92
|
+
|
|
93
|
+
<pre>
|
|
94
|
+
<code>
|
|
95
|
+
set :scm, :git
|
|
96
|
+
</code>
|
|
97
|
+
</pre>
|
|
98
|
+
|
|
99
|
+
Next, run the following task to import your application into a Git/SVN repository on your Rails Machine:
|
|
100
|
+
|
|
101
|
+
<pre>
|
|
102
|
+
<code>
|
|
103
|
+
$ cap repos:setup
|
|
104
|
+
</code>
|
|
105
|
+
</pre>
|
|
106
|
+
|
|
107
|
+
h2. Initial Deploy
|
|
108
|
+
|
|
109
|
+
That's it! You're ready to use Capistrano to deploy your app for the first time:
|
|
110
|
+
|
|
111
|
+
<pre>
|
|
112
|
+
<code>
|
|
113
|
+
$ cap deploy:cold
|
|
114
|
+
</code>
|
|
115
|
+
</pre>
|
|
116
|
+
|
|
117
|
+
Once that's done, open your application in a web browser and test it out!
|
|
118
|
+
|
|
119
|
+
To perform a subsequent deploy with Capistrano:
|
|
120
|
+
|
|
121
|
+
<pre>
|
|
122
|
+
<code>
|
|
123
|
+
$ cap deploy
|
|
124
|
+
</code>
|
|
125
|
+
</pre>
|
|
126
|
+
|
|
127
|
+
or, if you need to run migrations as well:
|
|
128
|
+
|
|
129
|
+
<pre>
|
|
130
|
+
<code>
|
|
131
|
+
$ cap deploy:migrations
|
|
132
|
+
</code>
|
|
133
|
+
</pre>
|
|
@@ -52,7 +52,7 @@ role :scm, domain
|
|
|
52
52
|
# =============================================================================
|
|
53
53
|
# APPLICATION SERVER OPTIONS
|
|
54
54
|
# =============================================================================
|
|
55
|
-
# set :app_server,
|
|
55
|
+
# set :app_server, :mongrel # :mongrel or :passenger
|
|
56
56
|
|
|
57
57
|
# =============================================================================
|
|
58
58
|
# WEB SERVER OPTIONS
|
data/lib/railsmachine/recipes.rb
CHANGED
|
@@ -3,14 +3,44 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
3
3
|
default_run_options[:pty] = true
|
|
4
4
|
set :keep_releases, 3
|
|
5
5
|
set :app_symlinks, nil
|
|
6
|
-
set :scm, :subversion
|
|
6
|
+
set :scm, :subversion
|
|
7
7
|
set :httpd, :apache
|
|
8
|
-
set :app_server, :mongrel
|
|
8
|
+
set :app_server, :mongrel
|
|
9
9
|
set :db_adapter, :mysql
|
|
10
10
|
set :rails_env, "production"
|
|
11
|
-
|
|
12
|
-
load 'config/deploy'
|
|
13
11
|
|
|
12
|
+
# mongrel defaults
|
|
13
|
+
set :mongrel_servers, 2
|
|
14
|
+
set :mongrel_port, 8000
|
|
15
|
+
set :mongrel_address, "127.0.0.1"
|
|
16
|
+
set :mongrel_environment, "production"
|
|
17
|
+
set :mongrel_conf, nil
|
|
18
|
+
set :mongrel_user, nil
|
|
19
|
+
set :mongrel_group, nil
|
|
20
|
+
set :mongrel_prefix, nil
|
|
21
|
+
set :mongrel_rails, 'mongrel_rails'
|
|
22
|
+
set :mongrel_clean, false
|
|
23
|
+
set :mongrel_pid_file, nil
|
|
24
|
+
set :mongrel_log_file, nil
|
|
25
|
+
set :mongrel_config_script, nil
|
|
26
|
+
|
|
27
|
+
# passenger defaults
|
|
28
|
+
set :use_mod_rewrite, false
|
|
29
|
+
|
|
30
|
+
# apache defaults
|
|
31
|
+
set :apache_server_name, nil
|
|
32
|
+
set :apache_conf, nil
|
|
33
|
+
set :apache_default_vhost, false
|
|
34
|
+
set :apache_default_vhost_conf, nil
|
|
35
|
+
set :apache_ctl, "/etc/init.d/httpd"
|
|
36
|
+
set :apache_server_aliases, []
|
|
37
|
+
set :apache_proxy_port, 8000
|
|
38
|
+
set :apache_proxy_servers, 2
|
|
39
|
+
set :apache_proxy_address, "127.0.0.1"
|
|
40
|
+
set :apache_ssl_enabled, false
|
|
41
|
+
set :apache_ssl_ip, nil
|
|
42
|
+
set :apache_ssl_forward_all, false
|
|
43
|
+
|
|
14
44
|
set :repository do
|
|
15
45
|
scm = fetch(:scm)
|
|
16
46
|
repos_base = "#{user}@#{domain}#{deploy_to}"
|
|
@@ -20,7 +50,6 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
20
50
|
"ssh://#{repos_base}/repos/#{application}.git"
|
|
21
51
|
end
|
|
22
52
|
end
|
|
23
|
-
|
|
24
53
|
|
|
25
54
|
task :validate_required_variables do
|
|
26
55
|
validate_option(:scm, :in => [:subversion, :git])
|
|
@@ -73,7 +102,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
73
102
|
namespace :app do
|
|
74
103
|
|
|
75
104
|
desc <<-DESC
|
|
76
|
-
Setup
|
|
105
|
+
Setup application server.
|
|
77
106
|
DESC
|
|
78
107
|
task :setup, :roles => :app do
|
|
79
108
|
case app_server.to_s
|
|
@@ -188,6 +217,7 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
|
188
217
|
task :setup, :roles => :scm do
|
|
189
218
|
begin
|
|
190
219
|
sudo "chown -R #{user}:#{user} #{deploy_to.gsub(application,'')}"
|
|
220
|
+
dump_settings
|
|
191
221
|
localrepo.setup
|
|
192
222
|
rescue
|
|
193
223
|
puts "repos:setup failed!"
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
|
2
|
-
load 'config/deploy'
|
|
3
2
|
namespace :deploy do
|
|
4
3
|
|
|
5
4
|
desc <<-DESC
|
|
6
|
-
|
|
5
|
+
Start the application server processes.
|
|
7
6
|
DESC
|
|
8
7
|
task :start, :roles => :app do
|
|
9
8
|
application_servlet.start
|
|
10
9
|
end
|
|
11
10
|
|
|
12
11
|
desc <<-DESC
|
|
13
|
-
Restart the
|
|
12
|
+
Restart the application server processes.
|
|
14
13
|
DESC
|
|
15
14
|
task :restart, :roles => :app do
|
|
16
15
|
application_servlet.restart
|
|
17
16
|
end
|
|
18
17
|
|
|
19
18
|
desc <<-DESC
|
|
20
|
-
|
|
19
|
+
Stop the application server processes.
|
|
21
20
|
DESC
|
|
22
21
|
task :stop, :roles => :app do
|
|
23
22
|
application_servlet.stop
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
Capistrano::Configuration.instance(:must_exist).load do
|
|
2
|
-
set :mongrel_servers, 2
|
|
3
|
-
set :mongrel_port, 8000
|
|
4
|
-
set :mongrel_address, "127.0.0.1"
|
|
5
|
-
set :mongrel_environment, "production"
|
|
6
|
-
set :mongrel_conf, nil
|
|
7
|
-
set :mongrel_user, nil
|
|
8
|
-
set :mongrel_group, nil
|
|
9
|
-
set :mongrel_prefix, nil
|
|
10
|
-
set :mongrel_rails, 'mongrel_rails'
|
|
11
|
-
set :mongrel_clean, false
|
|
12
|
-
set :mongrel_pid_file, nil
|
|
13
|
-
set :mongrel_log_file, nil
|
|
14
|
-
set :mongrel_config_script, nil
|
|
15
|
-
|
|
16
|
-
load 'config/deploy'
|
|
17
2
|
|
|
18
3
|
namespace :mongrel do
|
|
19
4
|
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
require 'erb'
|
|
2
2
|
Capistrano::Configuration.instance(:must_exist).load do
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
set :apache_server_name, nil
|
|
6
|
-
set :apache_conf, nil
|
|
7
|
-
set :apache_default_vhost, false
|
|
8
|
-
set :apache_default_vhost_conf, nil
|
|
9
|
-
set :apache_ctl, "/etc/init.d/httpd"
|
|
10
|
-
set :apache_server_aliases, []
|
|
11
|
-
set :apache_proxy_port, 8000
|
|
12
|
-
set :apache_proxy_servers, 2
|
|
13
|
-
set :apache_proxy_address, "127.0.0.1"
|
|
14
|
-
set :apache_ssl_enabled, false
|
|
15
|
-
set :apache_ssl_ip, nil
|
|
16
|
-
set :apache_ssl_forward_all, false
|
|
17
|
-
|
|
18
|
-
load 'config/deploy'
|
|
19
|
-
|
|
20
4
|
namespace :apache do
|
|
21
5
|
|
|
22
6
|
desc "Configure Apache. This uses the :use_sudo
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: railsmachine-railsmachine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rails Machine
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-12-
|
|
12
|
+
date: 2008-12-29 00:00:00 -08:00
|
|
13
13
|
default_executable: railsmachine
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|