super_mega_ultra_capistrano_extensions 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  require "super_mega_ultra_capistrano_extensions/version"
2
2
 
3
+ require "super_mega_ultra_capistrano_extensions/recipes/app"
3
4
  require "super_mega_ultra_capistrano_extensions/recipes/app_server"
4
5
  require "super_mega_ultra_capistrano_extensions/recipes/config"
5
6
  require "super_mega_ultra_capistrano_extensions/recipes/deploy"
@@ -0,0 +1,18 @@
1
+ Capistrano::Configuration.instance(:must_exist).load do
2
+ after "deploy:finalize_update", "app:permissions"
3
+
4
+ namespace :app do
5
+ desc <<-DESC
6
+ Change application permissions.
7
+
8
+ Because the user deploying the application is different to the user
9
+ running the application we need to ensure that the permissions on
10
+ directories are what we expect.
11
+ DESC
12
+ task :permissions, :except => {:no_release => true} do
13
+ run "chown -R #{user}:www-data #{latest_release}"
14
+ run "chmod -R g+r #{latest_release}"
15
+ run "chmod -R g+w #{latest_release}/tmp"
16
+ end
17
+ end
18
+ end
@@ -9,9 +9,11 @@ Capistrano::Configuration.instance(:must_exist).load do
9
9
  configuration files in our shared directory and our application.
10
10
  DESC
11
11
  task :symlink, :except => {:no_release => true} do
12
- config_files.each do |file|
13
- run "ln -nfs #{shared_path}/config/#{file} #{latest_release}/config/#{file}"
12
+ symlinks = config_files.inject([]) do |commands, file|
13
+ commands << "ln -nfs #{shared_path}/config/#{file} #{latest_release}/config/#{file}"
14
14
  end
15
+
16
+ run symlinks.join(' && ')
15
17
  end
16
18
  end
17
19
  end
@@ -11,6 +11,11 @@ Capistrano::Configuration.instance(:must_exist).load do
11
11
  set :rake, "bundle exec rake"
12
12
  set :config_files, fetch(:config_files) { [] }
13
13
  set :job_runner?, fetch(:job_runner, false)
14
+ set :migrate?, fetch(:run_migrations, false)
15
+ set :group_writable, false
16
+
17
+ after "deploy:update_code", "deploy:migrate" if migrate?
18
+ after "deploy:restart", "deploy:cleanup"
14
19
 
15
20
  namespace :deploy do
16
21
  desc <<-DESC
@@ -1,3 +1,3 @@
1
1
  module SuperMegaUltraCapistranoExtensions
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: super_mega_ultra_capistrano_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
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: 2012-08-02 00:00:00.000000000 Z
12
+ date: 2012-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: capistrano
@@ -40,6 +40,7 @@ files:
40
40
  - README.md
41
41
  - Rakefile
42
42
  - lib/super_mega_ultra_capistrano_extensions.rb
43
+ - lib/super_mega_ultra_capistrano_extensions/recipes/app.rb
43
44
  - lib/super_mega_ultra_capistrano_extensions/recipes/app_server.rb
44
45
  - lib/super_mega_ultra_capistrano_extensions/recipes/config.rb
45
46
  - lib/super_mega_ultra_capistrano_extensions/recipes/deploy.rb