capistrano-drush-make 0.1.0

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.
Files changed (3) hide show
  1. data/README.md +21 -0
  2. data/lib/capistrano-drush-make.rb +69 -0
  3. metadata +59 -0
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ version 0.1.0
2
+
3
+ ## DESCRIPTION
4
+
5
+ Provides capistrano deployment strategy for Drupal Drush Makefiles. Initial
6
+ this gem is build on top of capistrano-ash. Further development will likely
7
+ require ditching this requirement.
8
+
9
+ ## REQUIREMENTS
10
+
11
+ * Capistrano
12
+ * Capistrano-ext
13
+ * railsless-deloy
14
+ * capistrano-ash
15
+
16
+ ## USAGE
17
+
18
+ # gem install capistrano-drush-make
19
+
20
+ Default vs Multisite
21
+
@@ -0,0 +1,69 @@
1
+ require 'capistrano/recipes/deploy/strategy/remote_cache'
2
+ require 'ash/drupal'
3
+
4
+ module Capistrano
5
+ module Deploy
6
+ module Strategy
7
+
8
+ # Implements the deployment strategy that uses remote cache. Then calls
9
+ # drush make to deploy the drupal code to the final deployment location.
10
+ class DrushMake < RemoteCache
11
+ # Executes the SCM command for this strategy and writes the REVISION
12
+ # mark file to each host.
13
+ def deploy!
14
+ update_repository_cache
15
+ drush_make_repository_cache
16
+ end
17
+
18
+ def check!
19
+ super.check do |d|
20
+ d.remote.command("drush")
21
+ d.remote.writable(shared_path)
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ def drush_make_repository_cache
28
+ drush_makefile = configuration[:drush_makefile] || 'distro.make'
29
+ logger.trace "Build drush make the cached version to #{configuration[:release_path]}"
30
+ run "drush make #{repository_cache}/#{drush_makefile} #{configuration[:release_path]} && #{mark}"
31
+ end
32
+
33
+ end
34
+
35
+ end
36
+ end
37
+ end
38
+
39
+
40
+ configuration = Capistrano::Configuration.respond_to?(:instance) ?
41
+ Capistrano::Configuration.instance(:must_exist) :
42
+ Capistrano.configuration(:must_exist)
43
+
44
+ configuration.load do
45
+
46
+ after "drupal:symlink","drupal:symlink_default_multisite"
47
+
48
+ namespace :deploy do
49
+ desc "Override ash, this is skipped"
50
+ task :setup_local do
51
+ # skip
52
+ logger.info %q<Overrode ash :setup_local system('cp .htaccess htaccess.dist')>
53
+ end
54
+ end
55
+
56
+ namespace :drupal do
57
+ desc "Symlink shared directories"
58
+ task :symlink, :roles => :web, :except => { :no_release => true } do
59
+ multisites.each_pair do |folder, url|
60
+ run "ln -nfs #{shared_path}/#{url} #{latest_release}/sites/#{url}"
61
+ end
62
+ end
63
+
64
+ desc "Symlink default to multisite"
65
+ task :symlink_default_multisite, :roles => :web, :except => { :no_release => true } do
66
+ run "rm -rf #{latest_release}/sites/default && ln -nfs #{latest_release}/sites/#{default_multisite} #{latest_release}/sites/default"
67
+ end
68
+ end
69
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano-drush-make
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Christian Pearce
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-02-13 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano
16
+ requirement: &16616500 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '2.0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *16616500
25
+ description: Drush makefiles are used to build a drupal code base with specific version. This
26
+ gem focused on deploying with those makefiles
27
+ email: pearcec@xforty.com
28
+ executables: []
29
+ extensions: []
30
+ extra_rdoc_files:
31
+ - README.md
32
+ files:
33
+ - README.md
34
+ - lib/capistrano-drush-make.rb
35
+ homepage: https://github.com/xforty/capistrano-drush-make
36
+ licenses: []
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ required_rubygems_version: !ruby/object:Gem::Requirement
48
+ none: false
49
+ requirements:
50
+ - - ! '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ requirements: []
54
+ rubyforge_project:
55
+ rubygems_version: 1.8.10
56
+ signing_key:
57
+ specification_version: 3
58
+ summary: Deployment strategy for Drupal drush makefiles
59
+ test_files: []