capifony 0.4.3 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +6 -0
- data/bin/capifony +47 -12
- data/lib/capifony.rb +3 -565
- data/lib/symfony1.rb +569 -0
- data/lib/symfony2.rb +215 -0
- metadata +11 -9
data/lib/symfony2.rb
ADDED
@@ -0,0 +1,215 @@
|
|
1
|
+
load Gem.required_location('capifony', 'capifony.rb')
|
2
|
+
|
3
|
+
# Symfony application path
|
4
|
+
set :app_path, "app"
|
5
|
+
|
6
|
+
# Symfony web path
|
7
|
+
set :web_path, "web"
|
8
|
+
|
9
|
+
# Use AsseticBundle
|
10
|
+
set :dump_assetic_assets, false
|
11
|
+
|
12
|
+
# Dirs that need to remain the same between deploys (shared dirs)
|
13
|
+
set :shared_children, [app_path + "/logs", web_path + "/uploads"]
|
14
|
+
|
15
|
+
# Files that need to remain the same between deploys
|
16
|
+
set :shared_files, false
|
17
|
+
|
18
|
+
# Asset folders (that need to be timestamped)
|
19
|
+
set :asset_children, [web_path + "/css", web_path + "/images", web_path + "/js"]
|
20
|
+
|
21
|
+
namespace :deploy do
|
22
|
+
desc "Symlink static directories and static files that need to remain between deployments."
|
23
|
+
task :share_childs do
|
24
|
+
if shared_children
|
25
|
+
shared_children.each do |link|
|
26
|
+
run "mkdir -p #{shared_path}/#{link}"
|
27
|
+
run "if [ -d #{release_path}/#{link} ] ; then rm -rf #{release_path}/#{link}; fi"
|
28
|
+
run "ln -nfs #{shared_path}/#{link} #{release_path}/#{link}"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
if shared_files
|
32
|
+
shared_files.each do |link|
|
33
|
+
link_dir = File.dirname("#{shared_path}/#{link}")
|
34
|
+
run "mkdir -p #{link_dir}"
|
35
|
+
run "touch #{shared_path}/#{link}"
|
36
|
+
run "ln -nfs #{shared_path}/#{link} #{release_path}/#{link}"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Update latest release source path."
|
42
|
+
task :finalize_update, :except => { :no_release => true } do
|
43
|
+
run "chmod -R g+w #{latest_release}" if fetch(:group_writable, true)
|
44
|
+
run "if [ -d #{latest_release}/#{app_path}/cache ] ; then rm -rf #{latest_release}/#{app_path}/cache; fi"
|
45
|
+
run "mkdir -p #{latest_release}/#{app_path}/cache && chmod -R 0777 #{latest_release}/#{app_path}/cache"
|
46
|
+
|
47
|
+
share_childs
|
48
|
+
|
49
|
+
if fetch(:normalize_asset_timestamps, true)
|
50
|
+
stamp = Time.now.utc.strftime("%Y%m%d%H%M.%S")
|
51
|
+
asset_paths = asset_children.map { |p| "#{latest_release}/#{p}" }.join(" ")
|
52
|
+
run "find #{asset_paths} -exec touch -t #{stamp} {} ';'; true", :env => { "TZ" => "UTC" }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
desc "Deploy the application and start it."
|
57
|
+
task :cold do
|
58
|
+
update
|
59
|
+
start
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Deploy the application and run the test suite."
|
63
|
+
task :testall do
|
64
|
+
update_code
|
65
|
+
symlink
|
66
|
+
run "cd #{latest_release} && phpunit -c #{app_path} src"
|
67
|
+
end
|
68
|
+
|
69
|
+
desc "Migrate Symfony2 Doctrine ORM database."
|
70
|
+
task :migrate do
|
71
|
+
symfony.doctrine.migrations.migrate
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
namespace :symfony do
|
76
|
+
desc "Runs custom symfony task"
|
77
|
+
task :default do
|
78
|
+
prompt_with_default(:task_arguments, "cache:clear")
|
79
|
+
|
80
|
+
stream "cd #{latest_release} && #{php_bin} #{app_path}/console #{task_arguments}"
|
81
|
+
end
|
82
|
+
|
83
|
+
namespace :assets do
|
84
|
+
desc "Install bundle's assets"
|
85
|
+
task :install do
|
86
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console assets:install #{web_path}"
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
namespace :assetic do
|
91
|
+
desc "Dumps all assets to the filesystem"
|
92
|
+
task :dump do
|
93
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console assets:install #{web_path} --env=#{symfony_env_prod}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
namespace :cache do
|
98
|
+
desc "Clears project cache."
|
99
|
+
task :clear do
|
100
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:clear"
|
101
|
+
end
|
102
|
+
|
103
|
+
desc "Warms up an empty cache."
|
104
|
+
task :warmup do
|
105
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console cache:warmup"
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
namespace :doctrine do
|
110
|
+
namespace :cache do
|
111
|
+
desc "Clear all metadata cache for a entity manager."
|
112
|
+
task :clear_metadata do
|
113
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-metadata"
|
114
|
+
end
|
115
|
+
|
116
|
+
desc "Clear all query cache for a entity manager."
|
117
|
+
task :clear_query do
|
118
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-query"
|
119
|
+
end
|
120
|
+
|
121
|
+
desc "Clear result cache for a entity manager."
|
122
|
+
task :clear_result do
|
123
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:cache:clear-result"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
namespace :database do
|
128
|
+
desc "Create the configured databases."
|
129
|
+
task :create do
|
130
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:create"
|
131
|
+
end
|
132
|
+
|
133
|
+
desc "Drop the configured databases."
|
134
|
+
task :drop do
|
135
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:database:drop"
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
139
|
+
namespace :generate do
|
140
|
+
desc "Generates proxy classes for entity classes."
|
141
|
+
task :hydrators do
|
142
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:proxies"
|
143
|
+
end
|
144
|
+
|
145
|
+
desc "Generate repository classes from your mapping information."
|
146
|
+
task :hydrators do
|
147
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:generate:repositories"
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
namespace :schema do
|
152
|
+
desc "Processes the schema and either create it directly on EntityManager Storage Connection or generate the SQL output."
|
153
|
+
task :create do
|
154
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:create"
|
155
|
+
end
|
156
|
+
|
157
|
+
desc "Drop the complete database schema of EntityManager Storage Connection or generate the corresponding SQL output."
|
158
|
+
task :drop do
|
159
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:schema:drop"
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
namespace :migrations do
|
164
|
+
desc "Execute a migration to a specified version or the latest available version."
|
165
|
+
task :migrate do
|
166
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:migrate"
|
167
|
+
end
|
168
|
+
|
169
|
+
desc "View the status of a set of migrations."
|
170
|
+
task :status do
|
171
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:migrations:status"
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
175
|
+
namespace :mongodb do
|
176
|
+
namespace :generate do
|
177
|
+
desc "Generates hydrator classes for document classes."
|
178
|
+
task :hydrators do
|
179
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:hydrators"
|
180
|
+
end
|
181
|
+
|
182
|
+
desc "Generates proxy classes for document classes."
|
183
|
+
task :hydrators do
|
184
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:proxies"
|
185
|
+
end
|
186
|
+
|
187
|
+
desc "Generates repository classes for document classes."
|
188
|
+
task :hydrators do
|
189
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:generate:repositories"
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
namespace :schema do
|
194
|
+
desc "Allows you to create databases, collections and indexes for your documents."
|
195
|
+
task :create do
|
196
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:create"
|
197
|
+
end
|
198
|
+
|
199
|
+
desc "Allows you to drop databases, collections and indexes for your documents."
|
200
|
+
task :drop do
|
201
|
+
run "cd #{latest_release} && #{php_bin} #{app_path}/console doctrine:mongodb:schema:drop"
|
202
|
+
end
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# After finalizing update:
|
209
|
+
after "deploy:finalize_update" do
|
210
|
+
symfony.cache.warmup # 1. Warmup clean cache
|
211
|
+
symfony.assets.install # 2. Publish bundle assets
|
212
|
+
if dump_assetic_assets
|
213
|
+
symfony.assetic.dump # 3. Dump assetic assets
|
214
|
+
end
|
215
|
+
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:
|
5
|
-
prerelease:
|
4
|
+
hash: 15
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
|
+
- 2
|
8
|
+
- 0
|
7
9
|
- 0
|
8
|
-
|
9
|
-
- 3
|
10
|
-
version: 0.4.3
|
10
|
+
version: 2.0.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Konstantin Kudryashov
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-03-22 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -34,7 +34,7 @@ dependencies:
|
|
34
34
|
version: 2.5.10
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
|
-
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 \xE2\x80\x9Crecipe\xE2\x80\x9D to work with symfony
|
37
|
+
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 \xE2\x80\x9Crecipe\xE2\x80\x9D to work with symfony (both 1 and 2) applications.\n"
|
38
38
|
email: ever.zet@gmail.com
|
39
39
|
executables:
|
40
40
|
- capifony
|
@@ -45,11 +45,13 @@ extra_rdoc_files: []
|
|
45
45
|
files:
|
46
46
|
- bin/capifony
|
47
47
|
- lib/capifony.rb
|
48
|
+
- lib/symfony1.rb
|
49
|
+
- lib/symfony2.rb
|
48
50
|
- README
|
49
51
|
- LICENSE
|
50
52
|
- CHANGELOG
|
51
53
|
has_rdoc: true
|
52
|
-
homepage: http://
|
54
|
+
homepage: http://capifony.info
|
53
55
|
licenses: []
|
54
56
|
|
55
57
|
post_install_message:
|
@@ -78,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
80
|
requirements: []
|
79
81
|
|
80
82
|
rubyforge_project: capifony
|
81
|
-
rubygems_version: 1.
|
83
|
+
rubygems_version: 1.4.2
|
82
84
|
signing_key:
|
83
85
|
specification_version: 3
|
84
86
|
summary: Deploying symfony PHP applications with Capistrano.
|