winton-ubistrano 1.2.4 → 1.2.6

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/changelog.markdown CHANGED
@@ -1,3 +1,19 @@
1
+ Version 1.2.6
2
+ -------------
3
+
4
+ * Sinatra projects should have their own config.ru present, getting rid of sinatra:install
5
+
6
+ Version 1.2.5
7
+ -------------
8
+
9
+ * Removing unnecessary tmp/restart.txt touch for PHP apps
10
+ * Fixed some of the mysql:backup tasks
11
+
12
+ Version 1.2.4
13
+ -------------
14
+
15
+ * Complete EC2/Ubuntu Hardy provision and deploy tested with Rails and Sinatra
16
+
1
17
  Version 1.2.3
2
18
  -------------
3
19
 
@@ -3,7 +3,10 @@ Capistrano::Configuration.instance(:must_exist).load do
3
3
  namespace :deploy do
4
4
  desc "Restart application"
5
5
  task :restart, :roles => :app, :except => { :no_release => true } do
6
- run_each "touch #{current_path}/tmp/restart.txt"
6
+ case platform
7
+ when :rails, :sinatra
8
+ run_each "touch #{current_path}/tmp/restart.txt"
9
+ end
7
10
  end
8
11
 
9
12
  desc "Start application"
@@ -34,7 +37,6 @@ Capistrano::Configuration.instance(:must_exist).load do
34
37
  when :sinatra
35
38
  sinatra.config.default
36
39
  deploy.update
37
- sinatra.install
38
40
  end
39
41
  apache.virtual_host.create
40
42
  deploy.start
@@ -46,10 +46,10 @@ Capistrano::Configuration.instance(:must_exist).load do
46
46
  namespace :backup do
47
47
  desc "Upload local backup to remote"
48
48
  task :local_to_server, :roles => :db do
49
- from = File.expand_path("~/db_backups/#{stage}/#{application}/#{backup_name}.bz2")
49
+ from = File.expand_path("backups/#{backup_name}.bz2", FileUtils.pwd)
50
50
  if File.exists?(from)
51
- run_each "mkdir -p #{shared_path}/db_backups"
52
- upload from, "#{shared_path}/db_backups/#{backup_name}.bz2"
51
+ run_each "mkdir -p #{shared_path}/backups"
52
+ upload from, "#{shared_path}/backups/#{backup_name}.bz2"
53
53
  else
54
54
  puts "Does not exist: #{from}"
55
55
  end
@@ -57,7 +57,7 @@ Capistrano::Configuration.instance(:must_exist).load do
57
57
 
58
58
  desc "Restore remote database from backup"
59
59
  task :restore, :roles => :db do
60
- run_each "bunzip2 < #{shared_path}/db_backups/#{backup_name}.bz2 | mysql -u #{application} --password=#{mysql_app_password} #{db_table}"
60
+ run_each "bunzip2 < #{shared_path}/backups/#{backup_name}.bz2 | mysql -u #{application} --password=#{mysql_app_password} #{db_table}"
61
61
  end
62
62
 
63
63
  desc "Backup database to local"
@@ -71,7 +71,7 @@ Capistrano::Configuration.instance(:must_exist).load do
71
71
  task :to_server, :roles => :db do
72
72
  run_each [
73
73
  "mkdir -p #{shared_path}/db_backups",
74
- "mysqldump --add-drop-table -u #{application} -p#{mysql_app_password} #{db_table}_production | bzip2 -c > #{shared_path}/db_backups/#{backup_name}.bz2"
74
+ "mysqldump --add-drop-table -u #{application} -p#{mysql_app_password} #{db_table} | bzip2 -c > #{shared_path}/db_backups/#{backup_name}.bz2"
75
75
  ]
76
76
  end
77
77
 
@@ -30,7 +30,7 @@ Capistrano::Configuration.instance(:must_exist).load do
30
30
 
31
31
  desc "Configure asset_packager"
32
32
  task :asset_packager do
33
- run "source ~/.bash_profile && cd #{release_path} && rake RAILS_ENV=production asset:packager:build_all"
33
+ run "cd #{release_path} && rake RAILS_ENV=production asset:packager:build_all"
34
34
  end
35
35
 
36
36
  desc "Configure rails_widget"
@@ -1,34 +1,15 @@
1
1
  Capistrano::Configuration.instance(:must_exist).load do
2
2
 
3
- namespace :sinatra do
4
- desc "Runs install.rb if exists"
5
- task :install do
6
- if yes(msg(:sinatra_install))
7
- run_puts "if [ -e #{current_path}/install.rb ]; then sudo ruby #{current_path}/install.rb; fi"
8
- end
9
- end
10
-
3
+ namespace :sinatra do
11
4
  namespace :config do
12
5
  desc "Creates config.ru in shared config"
13
6
  task :default do
14
- run "mkdir -p #{shared_path}/config"
15
- upload_from_erb "#{shared_path}/config/config.ru", binding, :folder => 'sinatra'
16
- end
17
-
18
- desc "Creates database.yml in the shared config"
19
- task :database, :roles => :app do
20
7
  run "mkdir -p #{shared_path}/config"
21
8
  Dir[File.expand_path('../../templates/rails/*', File.dirname(__FILE__))].each do |f|
22
9
  upload_from_erb "#{shared_path}/config/#{File.basename(f, '.erb')}", binding, :folder => 'rails'
23
10
  end
24
11
  end
25
12
 
26
- desc "Creates config.ru in shared config"
27
- task :rack, :roles => :app do
28
- run "mkdir -p #{shared_path}/config"
29
- upload_from_erb "#{shared_path}/config/config.ru", binding, :folder => 'sinatra'
30
- end
31
-
32
13
  desc "Copies files in the shared config folder into our app"
33
14
  task :to_app, :roles => :app do
34
15
  run "cp -Rf #{shared_path}/config/* #{release_path}"
data/ubistrano.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ubistrano'
3
- s.version = '1.2.4'
4
- s.date = '2008-02-22'
3
+ s.version = '1.2.6'
4
+ s.date = '2008-06-27'
5
5
 
6
6
  s.summary = "Provision and deploy to an Ubuntu/God/Apache/Passenger stack using Capistrano"
7
7
  s.description = "Provision and deploy to an Ubuntu/God/Apache/Passenger stack using Capistrano"
@@ -38,7 +38,6 @@ Gem::Specification.new do |s|
38
38
  templates/apache/virtual_host.erb
39
39
  templates/log/rotate.conf.erb
40
40
  templates/rails/database.yml.erb
41
- templates/sinatra/config.ru.erb
42
41
  templates/ubuntu/apache.god.erb
43
42
  templates/ubuntu/god.erb
44
43
  templates/ubuntu/god.god.erb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: winton-ubistrano
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Winton Welsh
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-02-22 00:00:00 -08:00
12
+ date: 2008-06-27 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -53,7 +53,6 @@ files:
53
53
  - templates/apache/virtual_host.erb
54
54
  - templates/log/rotate.conf.erb
55
55
  - templates/rails/database.yml.erb
56
- - templates/sinatra/config.ru.erb
57
56
  - templates/ubuntu/apache.god.erb
58
57
  - templates/ubuntu/god.erb
59
58
  - templates/ubuntu/god.god.erb
@@ -1,19 +0,0 @@
1
- require 'sinatra'
2
- require 'rubygems'
3
-
4
- Sinatra::Application.default_options.merge!(
5
- :run => false,
6
- :env => :production,
7
- :raise_errors => true,
8
- :app_file => 'init.rb',
9
- :root => '<%= deploy_to %>/current',
10
- :views => '<%= deploy_to %>/current/views',
11
- :public => '<%= deploy_to %>/current/public'
12
- )
13
-
14
- log = File.new('<%= deploy_to %>/shared/log/sinatra.log', 'a')
15
- STDOUT.reopen(log)
16
- STDERR.reopen(log)
17
-
18
- require 'init'
19
- run Sinatra.application