capifony 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ### 2.2.1 / November 2, 2012
2
+
3
+ * Move warn message to the description. Fix #201
4
+ * Update README (tests)
5
+ * Updated capistrano-maintenance version
6
+ * IMPORTANT: Fix maintenance tasks by adding a new dependency (capistrano-maintenance)
7
+ * Fix test, add more tests for the composer copy feature
8
+ * fix tests
9
+ * Update spec/capifony_symfony2_symfony_spec.rb
10
+ * Update lib/symfony2/symfony.rb
11
+ * Update lib/symfony2/symfony.rb
12
+ * Ignore "No such file or directory" on deploy:web:enable
13
+ * Added doctrine:fixtures:load
14
+ * [symfony1] Fix bad command with use_sudo = false
15
+ * Refactor symfony:vendors and symfony:cache tasks based on @leek work
16
+ * Fix composer tasks
17
+
1
18
  ### 2.2.0 / October 22, 2012
2
19
 
3
20
  * Minor fixes
data/README.md CHANGED
@@ -42,11 +42,11 @@ Read the [capifony documentation](http://capifony.org/)
42
42
  You need a set of dependencies in order to run the capifony's test suite.
43
43
  You can use **Bundler** to install these dependencies:
44
44
 
45
- bundle install --gemfile=.gemfile
45
+ BUNDLE_GEMFILE=.gemfile bundle install
46
46
 
47
47
  Then, run the tests using **Rake**:
48
48
 
49
- rake spec
49
+ BUNDLE_GEMFILE=.gemfile bundle exec rake spec
50
50
 
51
51
  For more information, see the `.travis.yml` file.
52
52
 
data/bin/capifony CHANGED
@@ -5,7 +5,7 @@ require 'fileutils'
5
5
 
6
6
  symfony_version = nil
7
7
  symfony_app_path = 'app'
8
- capifony_version = '2.2.0'
8
+ capifony_version = '2.2.1'
9
9
 
10
10
  OptionParser.new do |opts|
11
11
  opts.banner = "Usage: #{File.basename($0)} [path]"
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'capistrano'
3
+ require 'capistrano/maintenance'
3
4
  require 'colored'
4
5
  require 'fileutils'
5
6
  require 'inifile'
@@ -103,7 +103,7 @@ namespace :symfony do
103
103
  cmd << "cp #{release_path}/web/#{app}_#{env}.php #{release_path}/web/#{app}.php"
104
104
  end
105
105
 
106
- run "#{try_sudo} -s #{cmd.join(';')}" if cmd.join(';')
106
+ run "#{try_sudo} sh -c '#{cmd.join(';')}'" if cmd.join(';')
107
107
  end
108
108
  end
109
109
  end
@@ -69,6 +69,13 @@ namespace :symfony do
69
69
  end
70
70
  end
71
71
 
72
+ namespace :fixtures do
73
+ desc "Load data fixtures"
74
+ task :load, :roles => :app, :except => { :no_release => true } do
75
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:fixtures:load --env=#{symfony_env_prod}'", :once => true
76
+ end
77
+ end
78
+
72
79
  namespace :migrations do
73
80
  desc "Executes a migration to a specified version or the latest available version"
74
81
  task :migrate, :roles => :app, :except => { :no_release => true } do
@@ -58,28 +58,22 @@ namespace :symfony do
58
58
  end
59
59
 
60
60
  namespace :vendors do
61
- desc "Runs the bin/vendors script to install the vendors (fast if already installed)"
62
- task :install, :roles => :app, :except => { :no_release => true } do
63
- capifony_pretty_print "--> Installing vendors"
64
-
65
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_vendors} install'"
66
- capifony_puts_ok
67
- end
68
-
69
- desc "Runs the bin/vendors script to reinstall the vendors"
70
- task :reinstall, :roles => :app, :except => { :no_release => true } do
71
- capifony_pretty_print "--> Reinstalling vendors"
72
-
73
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_vendors} install --reinstall'"
74
- capifony_puts_ok
75
- end
76
-
77
- desc "Runs the bin/vendors script to upgrade the vendors"
78
- task :upgrade, :roles => :app, :except => { :no_release => true } do
79
- capifony_pretty_print "--> Upgrading vendors"
61
+ [:install, :reinstall, :upgrade].each do |action|
62
+ desc "Runs the bin/vendors script to #{action.to_s} the vendors"
63
+ task action, :roles => :app, :except => { :no_release => true } do
64
+ capifony_pretty_print "--> #{action.to_s.capitalize}ing vendors"
65
+
66
+ cmd = action.to_s
67
+ case action
68
+ when :reinstall
69
+ cmd = "install --reinstall"
70
+ when :upgrade
71
+ cmd = "update"
72
+ end
80
73
 
81
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_vendors} update'"
82
- capifony_puts_ok
74
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_vendors} #{cmd}'"
75
+ capifony_puts_ok
76
+ end
83
77
  end
84
78
  end
85
79
 
@@ -102,6 +96,12 @@ namespace :symfony do
102
96
  namespace :composer do
103
97
  desc "Gets composer and installs it"
104
98
  task :get, :roles => :app, :except => { :no_release => true } do
99
+ if remote_file_exists?("#{previous_release}/composer.phar")
100
+ capifony_pretty_print "--> Copying Composer from previous release"
101
+ run "#{try_sudo} sh -c 'cp #{previous_release}/composer.phar #{latest_release}/'"
102
+ capifony_puts_ok
103
+ end
104
+
105
105
  if !remote_file_exists?("#{latest_release}/composer.phar")
106
106
  capifony_pretty_print "--> Downloading Composer"
107
107
 
@@ -117,7 +117,7 @@ namespace :symfony do
117
117
  desc "Updates composer"
118
118
  task :self_update, :roles => :app, :except => { :no_release => true } do
119
119
  capifony_pretty_print "--> Updating Composer"
120
- try_sudo "#{composer_bin} self-update"
120
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{composer_bin} self-update'"
121
121
  capifony_puts_ok
122
122
  end
123
123
 
@@ -127,7 +127,7 @@ namespace :symfony do
127
127
  symfony.composer.self_update
128
128
  else
129
129
  symfony.composer.get
130
- composer_bin = "#{php_bin} composer.phar"
130
+ set :composer_bin, "#{php_bin} composer.phar"
131
131
  end
132
132
 
133
133
  capifony_pretty_print "--> Installing Composer dependencies"
@@ -141,7 +141,7 @@ namespace :symfony do
141
141
  symfony.composer.self_update
142
142
  else
143
143
  symfony.composer.get
144
- composer_bin = "#{php_bin} composer.phar"
144
+ set :composer_bin, "#{php_bin} composer.phar"
145
145
  end
146
146
 
147
147
  capifony_pretty_print "--> Updating Composer dependencies"
@@ -155,7 +155,7 @@ namespace :symfony do
155
155
  symfony.composer.self_update
156
156
  else
157
157
  symfony.composer.get
158
- composer_bin = "#{php_bin} composer.phar"
158
+ set :composer_bin, "#{php_bin} composer.phar"
159
159
  end
160
160
 
161
161
  capifony_pretty_print "--> Dumping an optimized autoloader"
@@ -165,22 +165,20 @@ namespace :symfony do
165
165
  end
166
166
 
167
167
  namespace :cache do
168
- desc "Clears cache"
169
- task :clear, :roles => :app, :except => { :no_release => true } do
170
- capifony_pretty_print "--> Clearing cache"
171
-
172
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} cache:clear --env=#{symfony_env_prod}'"
173
- run "#{try_sudo} chmod -R g+w #{latest_release}/#{cache_path}"
174
- capifony_puts_ok
175
- end
176
-
177
- desc "Warms up an empty cache"
178
- task :warmup, :roles => :app, :except => { :no_release => true } do
179
- capifony_pretty_print "--> Warming up cache"
168
+ [:clear, :warmup].each do |action|
169
+ desc "Cache #{action.to_s}"
170
+ task action, :roles => :app, :except => { :no_release => true } do
171
+ case action
172
+ when :clear
173
+ capifony_pretty_print "--> Clearing cache"
174
+ when :warmup
175
+ capifony_pretty_print "--> Warming up cache"
176
+ end
180
177
 
181
- run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} cache:warmup --env=#{symfony_env_prod}'"
182
- run "#{try_sudo} chmod -R g+w #{latest_release}/#{cache_path}"
183
- capifony_puts_ok
178
+ run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} cache:#{action.to_s} --env=#{symfony_env_prod}'"
179
+ run "#{try_sudo} chmod -R g+w #{latest_release}/#{cache_path}"
180
+ capifony_puts_ok
181
+ end
184
182
  end
185
183
  end
186
184
 
data/lib/symfony2/web.rb CHANGED
@@ -19,15 +19,9 @@ namespace :deploy do
19
19
  should either be a plaintext or an erb file.
20
20
 
21
21
  Further customization will require that you write your own task.
22
- DESC
23
- task :disable, :roles => :web, :except => { :no_release => true } do
24
- require 'erb'
25
- on_rollback { run "rm #{latest_release}/#{web_path}/#{maintenance_basename}.html" }
26
-
27
- warn <<-EOHTACCESS
28
22
 
29
- # Please add something like this to your site's Apache htaccess to redirect users to the maintenance page.
30
- # More Info: http://www.shiftcommathree.com/articles/make-your-rails-maintenance-page-respond-with-a-503
23
+ Add something like this to your site's Apache htaccess to redirect users to the maintenance page.
24
+ More Info: http://www.shiftcommathree.com/articles/make-your-rails-maintenance-page-respond-with-a-503
31
25
 
32
26
  ErrorDocument 503 /#{maintenance_basename}.html
33
27
  RewriteEngine On
@@ -36,7 +30,7 @@ namespace :deploy do
36
30
  RewriteCond %{SCRIPT_FILENAME} !#{maintenance_basename}.html
37
31
  RewriteRule ^.*$ - [redirect=503,last]
38
32
 
39
- # Or if you are using Nginx add this to your server config:
33
+ Or if you are using Nginx add this to your server config:
40
34
 
41
35
  if (-f $document_root/maintenance.html) {
42
36
  return 503;
@@ -46,7 +40,10 @@ namespace :deploy do
46
40
  rewrite ^(.*)$ /maintenance.html last;
47
41
  break;
48
42
  }
49
- EOHTACCESS
43
+ DESC
44
+ task :disable, :roles => :web, :except => { :no_release => true } do
45
+ require 'erb'
46
+ on_rollback { run "rm #{latest_release}/#{web_path}/#{maintenance_basename}.html" }
50
47
 
51
48
  reason = ENV['REASON']
52
49
  deadline = ENV['UNTIL']
@@ -63,7 +60,7 @@ namespace :deploy do
63
60
  web-accessible again.
64
61
  DESC
65
62
  task :enable, :roles => :web, :except => { :no_release => true } do
66
- run "#{try_sudo} rm #{latest_release}/#{web_path}/#{maintenance_basename}.html"
63
+ run "#{try_sudo} rm -f #{latest_release}/#{web_path}/#{maintenance_basename}.html"
67
64
  end
68
65
  end
69
66
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capifony
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
- - 0
10
- version: 2.2.0
9
+ - 1
10
+ version: 2.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Konstantin Kudryashov
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-10-22 00:00:00 Z
19
+ date: 2012-11-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: capistrano
@@ -24,14 +24,14 @@ dependencies:
24
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- hash: 35
29
+ hash: 49
30
30
  segments:
31
31
  - 2
32
- - 11
33
- - 0
34
- version: 2.11.0
32
+ - 13
33
+ - 5
34
+ version: 2.13.5
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency
@@ -66,6 +66,22 @@ dependencies:
66
66
  version: 2.0.2
67
67
  type: :runtime
68
68
  version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: capistrano-maintenance
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - "="
76
+ - !ruby/object:Gem::Version
77
+ hash: 27
78
+ segments:
79
+ - 0
80
+ - 0
81
+ - 2
82
+ version: 0.0.2
83
+ type: :runtime
84
+ version_requirements: *id004
69
85
  description: " Capistrano is an open source tool for running scripts on multiple servers. It\xE2\x80\x99s primary use is for easily deploying applications. While it was built specifically for deploying Rails apps, it\xE2\x80\x99s pretty simple to customize it to deploy other types of applications. This package is a deployment \"recipe\" to work with symfony (both 1 and 2) applications.\n"
70
86
  email:
71
87
  - ever.zet@gmail.com