capistrano-ash 1.1.4 → 1.1.5

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/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.1.5
2
+ * Added a common method and test tasks to check if a file exists on the remote server
3
+ * Added drupal:symlink_config_file as a utility task to check if the settings.php file exists in one of two formats (settings.ENV.php or settings.php.ENV)
4
+ * The 'default' directory in `sites` is no longer the default application directory to be replaced. Instead the `:multisites` variable now expects the `:application` variable will also represent a folder within the `sites` directory that will be used as the default site when running drush commands. (i.e., `set :multisites, { "#{application}" => "#{application}" }`)
5
+
1
6
  == 1.0.0
2
7
  * Added the drupal:htaccess task for copying distributed .htaccess files
3
8
  * Added example Drupal Capfile and staging/production deployment files
data/Rakefile CHANGED
@@ -7,7 +7,7 @@ begin
7
7
  gemspec.name = "capistrano-ash"
8
8
  gemspec.summary = "Useful task libraries for August Ash recipes for Capistrano"
9
9
  gemspec.description = "August Ash recipes for Capistrano"
10
- gemspec.email = "jake@augustash.com"
10
+ gemspec.email = "code@augustash.com"
11
11
  gemspec.homepage = "https://github.com/augustash/capistrano-ash"
12
12
  gemspec.authors = ["August Ash"]
13
13
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.4
1
+ 1.1.5
@@ -5,13 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{capistrano-ash}
8
- s.version = "1.1.3"
8
+ s.version = "1.1.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["August Ash"]
12
- s.date = %q{2011-05-19}
12
+ s.date = %q{2011-06-22}
13
13
  s.description = %q{August Ash recipes for Capistrano}
14
- s.email = %q{jake@augustash.com}
14
+ s.email = %q{code@augustash.com}
15
15
  s.extra_rdoc_files = [
16
16
  "README.textile"
17
17
  ]
data/lib/ash/base.rb CHANGED
@@ -105,7 +105,7 @@ configuration.load do
105
105
  run "echo $PATH"
106
106
  end
107
107
  end
108
-
108
+
109
109
  # --------------------------------------------
110
110
  # PHP tasks
111
111
  # --------------------------------------------
@@ -235,4 +235,29 @@ configuration.load do
235
235
  end
236
236
  end
237
237
 
238
+ # --------------------------------------------
239
+ # Remote File/Directory test tasks
240
+ # --------------------------------------------
241
+ namespace :remote do
242
+ namespace :file do
243
+ desc "Test: Task to test existence of missing file"
244
+ task :missing do
245
+ if remote_file_exists?('/dev/mull')
246
+ logger.info "FAIL - Why does the '/dev/mull' path exist???"
247
+ else
248
+ logger.info "GOOD - Verified the '/dev/mull' path does not exist!"
249
+ end
250
+ end
251
+
252
+ desc "Test: Task used to test existence of a present file"
253
+ task :exists do
254
+ if remote_file_exists?('/dev/null')
255
+ logger.info "GOOD - Verified the '/dev/null' path exists!"
256
+ else
257
+ logger.info "FAIL - WHAT happened to the '/dev/null' path???"
258
+ end
259
+ end
260
+ end
261
+ end
262
+
238
263
  end
data/lib/ash/common.rb CHANGED
@@ -14,4 +14,10 @@ end
14
14
  # +prompt+
15
15
  def text_prompt(prompt="Value: ")
16
16
  Capistrano::CLI.ui.ask(prompt) { |q| q.echo = true }
17
+ end
18
+
19
+ # Test to see if a file exists by providing
20
+ # the full path to the expected file location
21
+ def remote_file_exists?(full_path)
22
+ 'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
17
23
  end
data/lib/ash/drupal.rb CHANGED
@@ -11,7 +11,7 @@ configuration.load do
11
11
  # --------------------------------------------
12
12
  # Setting defaults
13
13
  # --------------------------------------------
14
- proc{_cset( :multisites, {"default" => "#{application}"} )}
14
+ proc{_cset( :multisites, {"#{application}" => "#{application}"} )}
15
15
  set :drush_bin, "drush"
16
16
 
17
17
  # --------------------------------------------
@@ -19,10 +19,9 @@ configuration.load do
19
19
  # --------------------------------------------
20
20
  after "deploy:setup", "deploy:setup_shared"
21
21
  after "deploy:finalize_update", "ash:fixperms"
22
- after "ash:fixperms", "drupal:protect"
23
22
  after "deploy:symlink", "drupal:symlink"
23
+ after "drupal:symlink","drupal:protect"
24
24
  after "deploy", "drupal:clearcache"
25
- after "deploy", "drupal:htaccess"
26
25
  after "deploy", "deploy:cleanup"
27
26
 
28
27
  # --------------------------------------------
@@ -95,11 +94,35 @@ configuration.load do
95
94
  desc "Symlink shared directories"
96
95
  task :symlink, :except => { :no_release => true } do
97
96
  multisites.each_pair do |folder, url|
97
+ # symlinks the appropriate environment's settings.php file
98
+ symlink_config_file
99
+
98
100
  run "ln -nfs #{shared_path}/#{url}/files #{latest_release}/sites/#{url}/files"
99
- run "ln -nfs #{latest_release}/sites/#{url}/settings.php.#{stage} #{latest_release}/sites/#{url}/settings.php"
100
101
  run "#{drush_bin} -l #{url} -r #{current_path} vset --yes file_directory_path sites/#{url}/files"
101
102
  end
102
103
  end
104
+
105
+ desc <<-DESC
106
+ Symlinks the appropriate environment's settings file within the proper sites directory
107
+
108
+ Assumes the environment's settings file will be in one of two formats:
109
+ settings.<environment>.php => new default
110
+ settings.php.<environment> => deprecated
111
+ DESC
112
+ task :symlink_config_file, :except => { :no_release => true} do
113
+ multisites.each_pair do |folder, url|
114
+ drupal_app_site_dir = " #{latest_release}/sites/#{url}"
115
+
116
+ case true
117
+ when remote_file_exists?("#{drupal_app_site_dir}/settings.#{stage}.php")
118
+ run "ln -nfs #{drupal_app_site_dir}/settings.#{stage}.php #{drupal_app_site_dir}/settings.php"
119
+ when remote_file_exists?("#{drupal_app_site_dir}/settings.php.#{stage}")
120
+ run "ln -nfs #{drupal_app_site_dir}/settings.php.#{stage} #{drupal_app_site_dir}/settings.php"
121
+ else
122
+ logger.important "Failed to symlink the settings.php file in #{drupal_app_site_dir} because an unknown pattern was used"
123
+ end
124
+ end
125
+ end
103
126
 
104
127
  desc "Replace local database paths with remote paths"
105
128
  task :updatedb, :except => { :no_release => true } do
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: capistrano-ash
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.1.4
5
+ version: 1.1.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - August Ash
@@ -10,12 +10,12 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-19 00:00:00 -05:00
13
+ date: 2011-06-22 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies: []
16
16
 
17
17
  description: August Ash recipes for Capistrano
18
- email: jake@augustash.com
18
+ email: code@augustash.com
19
19
  executables: []
20
20
 
21
21
  extensions: []