railsmachine 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,133 @@
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 :scm@ 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>
@@ -42,6 +42,9 @@ Capistrano::Configuration.instance(:must_exist).load do
42
42
  set :apache_ssl_ip, nil
43
43
  set :apache_ssl_forward_all, false
44
44
 
45
+ # mysql defaults
46
+ set :mysql_admin, nil
47
+
45
48
  set :repository do
46
49
  scm = fetch(:scm)
47
50
  repos_base = "#{user}@#{domain}#{deploy_to}"
@@ -79,7 +82,7 @@ Capistrano::Configuration.instance(:must_exist).load do
79
82
  Used to configure your deployment environment in one command.
80
83
  DESC
81
84
  task :setup do
82
- sudo "chown -R #{user}:#{user} #{deploy_to.gsub(application,'')}"
85
+ sudo "chown -R #{user}:#{user} #{File.dirname(deploy_to)}"
83
86
  deploy.setup
84
87
  begin
85
88
  db.setup
@@ -217,7 +220,7 @@ Capistrano::Configuration.instance(:must_exist).load do
217
220
  DESC
218
221
  task :setup, :roles => :scm do
219
222
  begin
220
- sudo "chown -R #{user}:#{user} #{deploy_to.gsub(application,'')}"
223
+ sudo "chown #{user}:#{user} #{deploy_to.gsub(application,'')}"
221
224
  localrepo.setup
222
225
  rescue
223
226
  puts "repos:setup failed!"
@@ -24,8 +24,6 @@ Capistrano.plugin :mysql_helper, MySQLMethods
24
24
 
25
25
  Capistrano::Configuration.instance(:must_exist).load do
26
26
 
27
- set :mysql_admin, nil
28
-
29
27
  namespace :db do
30
28
 
31
29
  desc "Execute MySQL statements using --execute option. Set the 'sql' variable."
@@ -8,6 +8,16 @@ Capistrano::Configuration.instance(:must_exist).load do
8
8
  set to true."
9
9
  task :configure, :roles => :web do
10
10
  set_apache_conf
11
+ conf_dir = File.dirname(apache_conf)
12
+
13
+ # Try to make the conf directory, in case user has configured something
14
+ # different, or conf/apps isn't present in the system image
15
+ run("[ -d #{conf_dir} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
16
+ if o =~ /no?/
17
+ puts "Directory #{conf_dir} not found, creating it..."
18
+ send(run_method, "mkdir -p #{conf_dir}")
19
+ end
20
+ end
11
21
 
12
22
  run("[ -f #{ apache_conf} ] && echo \"yes\" || echo \"no\"") do |c, s, o|
13
23
  if o =~ /yes?/
@@ -63,7 +73,7 @@ Capistrano::Configuration.instance(:must_exist).load do
63
73
  def set_apache_conf
64
74
  if apache_default_vhost
65
75
  set :apache_conf, "/etc/httpd/conf/default.conf" unless apache_default_vhost_conf
66
- else
76
+ else
67
77
  set :apache_conf, "/etc/httpd/conf/apps/#{application}.conf" unless apache_conf
68
78
  end
69
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: railsmachine
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
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: 2009-01-13 00:00:00 -05:00
12
+ date: 2009-10-29 00:00:00 -04:00
13
13
  default_executable: railsmachine
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -28,49 +28,37 @@ executables:
28
28
  - railsmachine
29
29
  extensions: []
30
30
 
31
- extra_rdoc_files:
32
- - README
31
+ extra_rdoc_files: []
32
+
33
33
  files:
34
- - COPYING
35
- - LICENSE
36
- - README
37
- - Rakefile
38
34
  - bin/railsmachine
39
- - test/cli
40
- - lib/railsmachine
41
- - lib/railsmachine/generators
42
35
  - lib/railsmachine/generators/loader.rb
43
- - lib/railsmachine/generators/railsmachine
44
36
  - lib/railsmachine/generators/railsmachine/railsmachine_generator.rb
45
- - lib/railsmachine/generators/railsmachine/templates
46
37
  - lib/railsmachine/generators/railsmachine/templates/deploy.rb
47
38
  - lib/railsmachine/generators/railsmachine/USAGE
48
- - lib/railsmachine/recipes
49
- - lib/railsmachine/recipes/app
50
39
  - lib/railsmachine/recipes/app/deploy.rb
51
40
  - lib/railsmachine/recipes/app/mongrel.rb
52
41
  - lib/railsmachine/recipes/app/passenger.rb
53
- - lib/railsmachine/recipes/db
54
42
  - lib/railsmachine/recipes/db/mysql.rb
55
43
  - lib/railsmachine/recipes/db/postgresql.rb
56
44
  - lib/railsmachine/recipes/db/sqlite3.rb
57
- - lib/railsmachine/recipes/scm
58
45
  - lib/railsmachine/recipes/scm/git.rb
59
46
  - lib/railsmachine/recipes/scm/subversion.rb
60
- - lib/railsmachine/recipes/web
61
47
  - lib/railsmachine/recipes/web/apache.rb
62
- - lib/railsmachine/recipes/web/templates
63
- - lib/railsmachine/recipes/web/templates/mongrel
64
48
  - lib/railsmachine/recipes/web/templates/mongrel/httpd-ssl.conf
65
49
  - lib/railsmachine/recipes/web/templates/mongrel/httpd.conf
66
- - lib/railsmachine/recipes/web/templates/passenger
67
50
  - lib/railsmachine/recipes/web/templates/passenger/httpd-ssl.conf
68
51
  - lib/railsmachine/recipes/web/templates/passenger/httpd.conf
69
52
  - lib/railsmachine/recipes.rb
70
- - tools/rakehelp.rb
71
53
  - resources/defaults.yaml
72
- has_rdoc: false
54
+ - tools/rakehelp.rb
55
+ - README.textile
56
+ - LICENSE
57
+ - COPYING
58
+ has_rdoc: true
73
59
  homepage: http://railsmachine.com/
60
+ licenses: []
61
+
74
62
  post_install_message:
75
63
  rdoc_options: []
76
64
 
@@ -91,9 +79,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
79
  requirements: []
92
80
 
93
81
  rubyforge_project: railsmachine
94
- rubygems_version: 1.3.1
82
+ rubygems_version: 1.3.3
95
83
  signing_key:
96
- specification_version: 2
84
+ specification_version: 3
97
85
  summary: The Rails Machine task library
98
86
  test_files: []
99
87
 
data/README DELETED
@@ -1,83 +0,0 @@
1
- Five Minute Rails Application Deployment
2
-
3
- Ready to deploy your Rails application to Rails Machine? Follow these steps and you’ll have it running in no time! Free to utilize Rails Machine’s Ask Us Anything Support and contact us with any questions you have along the way.
4
-
5
- Update Gems
6
-
7
- Install the latest version of the railsmachine gem:
8
-
9
- $ sudo gem install railsmachine
10
-
11
- Install Phusion Passenger and Ruby Enterprise Edition
12
-
13
- 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.
14
-
15
- $ wget http://assets.railsmachine.com/wiki/centos_passenger_install.sh
16
- $ sh centos_passenger_install.sh
17
-
18
- Setup Capistrano
19
-
20
- Capify your application:
21
-
22
- $ capify .
23
-
24
- Configure Capistrano for Rails Machine
25
-
26
- The following step customizes your config/deploy.rb with two bits of information you provide:
27
-
28
- --name: a simple name for your application. no spaces, please.
29
- example: my-cool-app
30
- --domain: the primary domain name for your application. please omit the ‘www’ – we automaticaly alias www.whateveryouprovide.com as needed.
31
- example: my-cool-app.com
32
- $ railsmachine --apply-to . --name my-cool-app --domain my-cool-app.com
33
-
34
- 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.
35
-
36
- Update Database Config
37
-
38
- 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.
39
-
40
- Application Setup
41
-
42
- Rails Machine defaults to using mongrel + mod_proxy_balancer to run your Rails Application. If you’d like to switch to Phusion Passenger, edit the line in your application’s config/deploy.rb that begins set :app_server to reflect your choice. For example:
43
-
44
- set :app_server, :passenger
45
-
46
- Run the following Capistrano task to setup your MySQL databases and configure your application servers (mongrel/passenger):
47
-
48
- $ cap servers:setup
49
-
50
- Source Control
51
-
52
- If you’re already using Source Control…
53
-
54
- ...edit the lines in your application’s config/deploy.rb that begin set :repository and set :repository. For example:
55
-
56
- set :scm, :git
57
- set :repository, "git@github.com:yourname/my-cool-app.git"
58
-
59
- If you’re not yet using Source Control…
60
-
61
- ...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:
62
-
63
- set :scm, :git
64
-
65
- Next, run the following task to import your application into a Git/SVN repository on your Rails Machine:
66
-
67
- $ cap repos:setup
68
-
69
- Initial Deploy
70
-
71
- That’s it! You’re ready to use Capistrano to deploy your app for the first time:
72
-
73
- $ cap deploy:cold
74
-
75
- Once that’s done, open your application in a web browser and test it out!
76
-
77
- To perform a subsequent deploy with Capistrano:
78
-
79
- $ cap deploy
80
-
81
- or, if you need to run migrations as well:
82
-
83
- $ cap deploy:migrations
data/Rakefile DELETED
@@ -1,53 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/clean'
4
- require 'rake/gempackagetask'
5
- require 'rake/rdoctask'
6
- require 'tools/rakehelp'
7
- require 'fileutils'
8
- include FileUtils
9
-
10
- setup_tests
11
- setup_clean ["pkg", "lib/*.bundle", "*.gem", ".config"]
12
-
13
- setup_rdoc ['README', 'LICENSE', 'COPYING', 'lib/**/*.rb', 'doc/**/*.rdoc']
14
-
15
- desc "Does a full compile, test run"
16
- task :default => [:test, :package]
17
-
18
- version="1.0.5"
19
- name="railsmachine"
20
-
21
- setup_gem(name, version) do |spec|
22
- spec.summary = "The Rails Machine task library"
23
- spec.description = spec.summary
24
- spec.author="Rails Machine"
25
- spec.add_dependency('capistrano', '>= 2.1.0')
26
- spec.has_rdoc = false
27
- spec.files += Dir.glob("bin/*")
28
- spec.files += Dir.glob("resources/**/*")
29
- spec.default_executable = "railsmachine"
30
- spec.executables = ["railsmachine"]
31
- spec.email = "support@railsmachine.com"
32
- spec.homepage = "http://railsmachine.com/"
33
- spec.rubyforge_project = "railsmachine"
34
- end
35
-
36
- task :install => [:test, :package] do
37
- sh %{sudo gem install pkg/#{name}-#{version}.gem}
38
- end
39
-
40
- task :uninstall => [:clean] do
41
- sh %{sudo gem uninstall #{name}}
42
- end
43
-
44
- task :gem_source do
45
- mkdir_p "pkg/gems"
46
-
47
- FileList["**/*.gem"].each { |gem| mv gem, "pkg/gems" }
48
- FileList["pkg/*.tgz"].each {|tgz| rm tgz }
49
- rm_rf "pkg/#{name}-#{version}"
50
-
51
- sh %{ generate_yaml_index.rb -d pkg }
52
- sh %{ scp -r pkg/* #{ENV['SSH_USER']}@rubyforge.org:/var/www/gforge-projects/railsmachine/releases/ }
53
- end