capistrano-django 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/capistrano/django.rb +31 -6
- metadata +2 -2
data/lib/capistrano/django.rb
CHANGED
@@ -4,11 +4,11 @@ namespace :deploy do
|
|
4
4
|
|
5
5
|
desc 'Restart application'
|
6
6
|
task :restart do
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
7
|
+
if fetch(:nginx)
|
8
|
+
invoke 'deploy:nginx_restart'
|
9
|
+
else
|
10
|
+
execute "sudo apache2ctl graceful"
|
11
|
+
end
|
12
12
|
end
|
13
13
|
|
14
14
|
task :nginx_restart do
|
@@ -35,6 +35,9 @@ namespace :python do
|
|
35
35
|
execute "#{virtualenv_path}/bin/pip install -r #{release_path}/#{fetch(:pip_requirements)}"
|
36
36
|
end
|
37
37
|
|
38
|
+
if fetch(:npm_tasks)
|
39
|
+
invoke 'nodejs:npm'
|
40
|
+
end
|
38
41
|
if fetch(:grunt_task)
|
39
42
|
invoke 'nodejs:grunt'
|
40
43
|
end
|
@@ -150,13 +153,35 @@ end
|
|
150
153
|
|
151
154
|
namespace :nodejs do
|
152
155
|
|
156
|
+
desc 'Install node modules'
|
157
|
+
task :npm_install do
|
158
|
+
on roles(:web) do
|
159
|
+
within release_path do
|
160
|
+
execute 'npm', 'install', '--production'
|
161
|
+
end
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
153
165
|
desc "Run a grunt task"
|
154
166
|
task :grunt do
|
167
|
+
invoke 'nodejs:npm_install'
|
155
168
|
on roles(:web) do
|
156
169
|
within release_path do
|
157
|
-
execute 'npm', 'install', '--production'
|
158
170
|
execute './node_modules/.bin/grunt', "#{fetch(:grunt_task)}"
|
159
171
|
end
|
160
172
|
end
|
161
173
|
end
|
174
|
+
|
175
|
+
desc 'Run npm tasks'
|
176
|
+
task :npm do
|
177
|
+
invoke 'nodejs:npm_install'
|
178
|
+
on roles(:web) do
|
179
|
+
within release_path do
|
180
|
+
fetch(:npm_tasks).each do |task, args|
|
181
|
+
execute "./node_modules/.bin/#{task}", args
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
162
187
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-django
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-09-
|
12
|
+
date: 2014-09-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: capistrano
|