capistrano-django 0.0.1
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/lib/capistrano/django.rb +81 -0
- data/lib/django_capistrano.rb +0 -0
- metadata +62 -0
@@ -0,0 +1,81 @@
|
|
1
|
+
|
2
|
+
unless Capistrano::Configuration.respond_to?(:instance)
|
3
|
+
abort "capistrano_django requires Capistrano 2"
|
4
|
+
end
|
5
|
+
|
6
|
+
Capistrano::Configuration.instance.load do
|
7
|
+
|
8
|
+
set :normalize_asset_timestamps, false
|
9
|
+
|
10
|
+
after 'deploy:update', 'deploy:cleanup'
|
11
|
+
after 'deploy:update_code', 'nodejs:install_deps'
|
12
|
+
after 'deploy:update_code', 'python:create_virtualenv'
|
13
|
+
after 'python:create_virtualenv', 'python:install_deps'
|
14
|
+
after 'python:install_deps', 'django:compress'
|
15
|
+
after 'django:compress', 'django:collectstatic'
|
16
|
+
after 'django:collectstatic', 'django:symlink_settings'
|
17
|
+
before 'deploy:create_symlink', 'django:migrate'
|
18
|
+
|
19
|
+
namespace :nodejs do
|
20
|
+
|
21
|
+
desc "Install node.js dependencies"
|
22
|
+
task :install_deps do
|
23
|
+
run "cd #{current_release}/devops && npm install"
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
namespace :python do
|
29
|
+
|
30
|
+
desc "Create a python virtualenv"
|
31
|
+
task :create_virtualenv do
|
32
|
+
run "virtualenv #{current_release}/virtualenv"
|
33
|
+
end
|
34
|
+
|
35
|
+
desc "Install python requirements"
|
36
|
+
task :install_deps do
|
37
|
+
pip = "#{current_release}/virtualenv/bin/pip"
|
38
|
+
run "#{pip} install -r #{current_release}/devops/requirements/#{django_env}.txt"
|
39
|
+
end
|
40
|
+
|
41
|
+
end
|
42
|
+
|
43
|
+
namespace :django do
|
44
|
+
|
45
|
+
def django(args, flags="")
|
46
|
+
python = "#{current_release}/virtualenv/bin/python"
|
47
|
+
run "#{python} #{current_release}/manage.py #{django_env} #{args} #{flags}"
|
48
|
+
end
|
49
|
+
|
50
|
+
desc "Run django-compressor"
|
51
|
+
task :compress do
|
52
|
+
django("compress")
|
53
|
+
end
|
54
|
+
|
55
|
+
desc "Run django's collectstatic"
|
56
|
+
task :collectstatic do
|
57
|
+
django("collectstatic", "-i *.coffee -i *.less --noinput")
|
58
|
+
end
|
59
|
+
|
60
|
+
desc "Run django migrations"
|
61
|
+
task :migrate do
|
62
|
+
django("syncdb", "--noinput --migrate")
|
63
|
+
end
|
64
|
+
|
65
|
+
desc "Symlink django settings to deployed.py"
|
66
|
+
task :symlink_settings do
|
67
|
+
run "ln -s #{current_release}/project/settings/#{django_env}.py #{current_release}/project/settings/deployed.py"
|
68
|
+
end
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
namespace :deploy do
|
73
|
+
|
74
|
+
desc "Restart apache"
|
75
|
+
task :restart do
|
76
|
+
run "sudo apache2ctl graceful"
|
77
|
+
end
|
78
|
+
|
79
|
+
end
|
80
|
+
|
81
|
+
end
|
File without changes
|
metadata
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano-django
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matthew J. Morrison
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-01-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: capistrano
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.14.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.14.1
|
30
|
+
description: capistrano-django provides a solid basis for common django deployment
|
31
|
+
email: mattjmorrison@mattjmorrison.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/capistrano/django.rb
|
37
|
+
- lib/django_capistrano.rb
|
38
|
+
homepage: http://github.com/mattjmorrison/django-capistrano
|
39
|
+
licenses: []
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
none: false
|
46
|
+
requirements:
|
47
|
+
- - ! '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
requirements: []
|
57
|
+
rubyforge_project:
|
58
|
+
rubygems_version: 1.8.23
|
59
|
+
signing_key:
|
60
|
+
specification_version: 3
|
61
|
+
summary: capistrano-django - Welcome to easy deployment with Ruby over SSH for Django
|
62
|
+
test_files: []
|