capifony 2.1.7 → 2.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +18 -0
- data/bin/capifony +5 -2
- data/lib/capifony.rb +15 -5
- data/lib/symfony1.rb +60 -575
- data/lib/symfony1/database.rb +118 -0
- data/lib/symfony1/deploy.rb +56 -0
- data/lib/symfony1/doctrine.rb +76 -0
- data/lib/symfony1/propel.rb +57 -0
- data/lib/symfony1/shared.rb +50 -0
- data/lib/symfony1/symfony.rb +187 -0
- data/lib/symfony1/web.rb +13 -0
- data/lib/symfony2.rb +26 -528
- data/lib/symfony2/database.rb +127 -0
- data/lib/symfony2/deploy.rb +86 -0
- data/lib/symfony2/doctrine.rb +118 -0
- data/lib/symfony2/output.rb +44 -0
- data/lib/symfony2/propel.rb +80 -0
- data/lib/symfony2/symfony.rb +118 -0
- data/lib/symfony2/web.rb +69 -0
- metadata +38 -8
@@ -0,0 +1,118 @@
|
|
1
|
+
namespace :symfony do
|
2
|
+
desc "Runs custom symfony command"
|
3
|
+
task :default do
|
4
|
+
prompt_with_default(:task_arguments, "cache:clear")
|
5
|
+
|
6
|
+
stream "cd #{latest_release} && #{php_bin} #{symfony_console} #{task_arguments} --env=#{symfony_env_prod}"
|
7
|
+
end
|
8
|
+
|
9
|
+
namespace :assets do
|
10
|
+
desc "Installs bundle's assets"
|
11
|
+
task :install do
|
12
|
+
pretty_print "--> Installing bundle's assets"
|
13
|
+
|
14
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_console} assets:install #{web_path} --env=#{symfony_env_prod}"
|
15
|
+
puts_ok
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
namespace :assetic do
|
20
|
+
desc "Dumps all assets to the filesystem"
|
21
|
+
task :dump do
|
22
|
+
puts "--> Dumping all assets to the filesystem"
|
23
|
+
|
24
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_console} assetic:dump --env=#{symfony_env_prod} --no-debug"
|
25
|
+
puts_ok
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
namespace :vendors do
|
30
|
+
desc "Runs the bin/vendors script to install the vendors (fast if already installed)"
|
31
|
+
task :install do
|
32
|
+
pretty_print "--> Installing vendors"
|
33
|
+
|
34
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_vendors} install"
|
35
|
+
puts_ok
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "Runs the bin/vendors script to reinstall the vendors"
|
39
|
+
task :reinstall do
|
40
|
+
pretty_print "--> Reinstalling vendors"
|
41
|
+
|
42
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_vendors} install --reinstall"
|
43
|
+
puts_ok
|
44
|
+
end
|
45
|
+
|
46
|
+
desc "Runs the bin/vendors script to upgrade the vendors"
|
47
|
+
task :upgrade do
|
48
|
+
pretty_print "--> Upgrading vendors"
|
49
|
+
|
50
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_vendors} update"
|
51
|
+
puts_ok
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
namespace :bootstrap do
|
56
|
+
desc "Runs the bin/build_bootstrap script"
|
57
|
+
task :build do
|
58
|
+
pretty_print "--> Building bootstrap file"
|
59
|
+
|
60
|
+
run "cd #{latest_release} && test -f #{build_bootstrap} && #{php_bin} #{build_bootstrap} || echo '#{build_bootstrap} not found, skipped'"
|
61
|
+
puts_ok
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
namespace :composer do
|
66
|
+
desc "Gets composer and installs it"
|
67
|
+
task :get do
|
68
|
+
pretty_print "--> Downloading Composer"
|
69
|
+
|
70
|
+
run "cd #{latest_release} && curl -s http://getcomposer.org/installer | #{php_bin}"
|
71
|
+
puts_ok
|
72
|
+
end
|
73
|
+
|
74
|
+
desc "Runs composer to install vendors from composer.lock file"
|
75
|
+
task :install do
|
76
|
+
if !File.exist?("#{latest_release}/composer.phar")
|
77
|
+
symfony.composer.get
|
78
|
+
end
|
79
|
+
|
80
|
+
pretty_print "--> Installing Composer dependencies"
|
81
|
+
|
82
|
+
run "cd #{latest_release} && #{php_bin} composer.phar install -v"
|
83
|
+
puts_ok
|
84
|
+
end
|
85
|
+
|
86
|
+
desc "Runs composer to update vendors, and composer.lock file"
|
87
|
+
task :update do
|
88
|
+
if !File.exist?("#{latest_release}/composer.phar")
|
89
|
+
symfony.composer.get
|
90
|
+
end
|
91
|
+
|
92
|
+
pretty_print "--> Updating Composer dependencies"
|
93
|
+
|
94
|
+
run "cd #{latest_release} && #{php_bin} composer.phar update -v"
|
95
|
+
puts_ok
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
namespace :cache do
|
100
|
+
desc "Clears cache"
|
101
|
+
task :clear do
|
102
|
+
pretty_print "--> Clearing cache"
|
103
|
+
|
104
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_console} cache:clear --env=#{symfony_env_prod}"
|
105
|
+
run "chmod -R g+w #{latest_release}/#{cache_path}"
|
106
|
+
puts_ok
|
107
|
+
end
|
108
|
+
|
109
|
+
desc "Warms up an empty cache"
|
110
|
+
task :warmup do
|
111
|
+
pretty_print "--> Warming up cache"
|
112
|
+
|
113
|
+
run "cd #{latest_release} && #{php_bin} #{symfony_console} cache:warmup --env=#{symfony_env_prod}"
|
114
|
+
run "chmod -R g+w #{latest_release}/#{cache_path}"
|
115
|
+
puts_ok
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
data/lib/symfony2/web.rb
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
namespace :deploy do
|
2
|
+
namespace :web do
|
3
|
+
desc <<-DESC
|
4
|
+
Present a maintenance page to visitors. Disables your application's web \
|
5
|
+
interface by writing a "#{maintenance_basename}.html" file to each web server. The \
|
6
|
+
servers must be configured to detect the presence of this file, and if \
|
7
|
+
it is present, always display it instead of performing the request.
|
8
|
+
|
9
|
+
By default, the maintenance page will just say the site is down for \
|
10
|
+
"maintenance", and will be back "shortly", but you can customize the \
|
11
|
+
page by specifying the REASON and UNTIL environment variables:
|
12
|
+
|
13
|
+
$ cap deploy:web:disable \\
|
14
|
+
REASON="hardware upgrade" \\
|
15
|
+
UNTIL="12pm Central Time"
|
16
|
+
|
17
|
+
You can use a different template for the maintenance page by setting the \
|
18
|
+
:maintenance_template_path variable in your deploy.rb file. The template file \
|
19
|
+
should either be a plaintext or an erb file.
|
20
|
+
|
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
|
+
|
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
|
31
|
+
|
32
|
+
ErrorDocument 503 /#{maintenance_basename}.html
|
33
|
+
RewriteEngine On
|
34
|
+
RewriteCond %{REQUEST_URI} !\.(css|gif|jpg|png)$
|
35
|
+
RewriteCond %{DOCUMENT_ROOT}/#{maintenance_basename}.html -f
|
36
|
+
RewriteCond %{SCRIPT_FILENAME} !#{maintenance_basename}.html
|
37
|
+
RewriteRule ^.*$ - [redirect=503,last]
|
38
|
+
|
39
|
+
# Or if you are using Nginx add this to your server config:
|
40
|
+
|
41
|
+
if (-f $document_root/maintenance.html) {
|
42
|
+
return 503;
|
43
|
+
}
|
44
|
+
error_page 503 @maintenance;
|
45
|
+
location @maintenance {
|
46
|
+
rewrite ^(.*)$ /maintenance.html last;
|
47
|
+
break;
|
48
|
+
}
|
49
|
+
EOHTACCESS
|
50
|
+
|
51
|
+
reason = ENV['REASON']
|
52
|
+
deadline = ENV['UNTIL']
|
53
|
+
template = File.read(maintenance_template_path)
|
54
|
+
result = ERB.new(template).result(binding)
|
55
|
+
|
56
|
+
put result, "#{latest_release}/#{web_path}/#{maintenance_basename}.html", :mode => 0644
|
57
|
+
end
|
58
|
+
|
59
|
+
desc <<-DESC
|
60
|
+
Makes the application web-accessible again. Removes the \
|
61
|
+
"#{maintenance_basename}.html" page generated by deploy:web:disable, which (if your \
|
62
|
+
web servers are configured correctly) will make your application \
|
63
|
+
web-accessible again.
|
64
|
+
DESC
|
65
|
+
task :enable, :roles => :web, :except => { :no_release => true } do
|
66
|
+
run "rm #{latest_release}/#{web_path}/#{maintenance_basename}.html"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
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:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 2.1.
|
9
|
+
- 8
|
10
|
+
version: 2.1.8
|
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-
|
19
|
+
date: 2012-07-02 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: capistrano
|
@@ -26,14 +26,30 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 35
|
30
30
|
segments:
|
31
31
|
- 2
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 2.
|
32
|
+
- 11
|
33
|
+
- 0
|
34
|
+
version: 2.11.0
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: colored
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 31
|
46
|
+
segments:
|
47
|
+
- 1
|
48
|
+
- 2
|
49
|
+
- 0
|
50
|
+
version: 1.2.0
|
51
|
+
type: :runtime
|
52
|
+
version_requirements: *id002
|
37
53
|
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"
|
38
54
|
email:
|
39
55
|
- ever.zet@gmail.com
|
@@ -47,7 +63,21 @@ extra_rdoc_files: []
|
|
47
63
|
files:
|
48
64
|
- bin/capifony
|
49
65
|
- lib/capifony.rb
|
66
|
+
- lib/symfony1/database.rb
|
67
|
+
- lib/symfony1/deploy.rb
|
68
|
+
- lib/symfony1/doctrine.rb
|
69
|
+
- lib/symfony1/propel.rb
|
70
|
+
- lib/symfony1/shared.rb
|
71
|
+
- lib/symfony1/symfony.rb
|
72
|
+
- lib/symfony1/web.rb
|
50
73
|
- lib/symfony1.rb
|
74
|
+
- lib/symfony2/database.rb
|
75
|
+
- lib/symfony2/deploy.rb
|
76
|
+
- lib/symfony2/doctrine.rb
|
77
|
+
- lib/symfony2/output.rb
|
78
|
+
- lib/symfony2/propel.rb
|
79
|
+
- lib/symfony2/symfony.rb
|
80
|
+
- lib/symfony2/web.rb
|
51
81
|
- lib/symfony2.rb
|
52
82
|
- README.md
|
53
83
|
- LICENSE
|