capistrano-ash 1.3.1 → 1.3.3

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.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NDU5ZDEzMTJhYjMzNGFiMzkwYWIzOTc0Y2ZiZjg1MmJjYjViNDFkZQ==
5
+ data.tar.gz: !binary |-
6
+ ZWU1ZGMzOTRhMGYxMzZiZjY5YzU1MjRkOGIyNzQzMDJkNTdmMTUyZQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ Njg3OTdmZTU2OTgyMDZmNzY3ZGIzZmYzM2ViMmY3NmY0ZWQ2ZGE4ZWJiYjJl
10
+ ZTE2NjA4MDlmOTlmZWUzY2RiNWQ3MmViNmRiYTlmNzU2Y2Y4ZTE1YjAwNzA0
11
+ NDQ3NmZhMDY5Mzg3Y2Y4OGQyODFjYjM3YzQxZjIyYTg0NmRjOTE=
12
+ data.tar.gz: !binary |-
13
+ OWY3Y2YwODJjNDljZGNiNTk3MjkxYWU5NTIxNTY0ODg0MmNkMTVjNDk5Y2Nk
14
+ Njc3ZjNhNDlhYzkxZGYzOTU2OTdlZmZlMzJlMGIyNWI4YTEyOTdjYjIzZTM5
15
+ YjNkNjdkZTExYWNhODdlOWUwZTQyNzhkZTZkYWJhOGE0ODk3ZWY=
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,15 @@
1
+ == 1.3.3
2
+ * FIXED: Issue #42 - chown backups path was failing miserably in the deploy:setup_backup task
3
+
4
+ == 1.3.2
5
+ * FIXED: Issue #28 - use try_sudo where appropriate
6
+ * FEATURE: Issue #33 - Enable git submodules by default if using git
7
+ * FIXED: Issue #34 - scp fails because of missing port option
8
+ * FIXED: Issue #37 - Rescue from errors during backup:cleanup
9
+ * MERGED PULL REQUEST: Issue #38 - improve set_perms_dirs and set_perms_files performance
10
+ * FIXED: Issue #39 - zend:symlink is run multiple times
11
+ * FEATURE: Issue #40 - check remote servers to see if drush is installed and available to the user
12
+
1
13
  == 1.3.1
2
14
  * Added additional variable (:skip_compass_compile) to skip the compilation and just upload stylesheets (useful for our upcoming Wraith theme)
3
15
  * Namespaced the commands within `compass:defualt` to avoid any future conflicts
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.1
1
+ 1.3.3
@@ -0,0 +1,61 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "capistrano-ash"
8
+ s.version = "1.3.3"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["August Ash"]
12
+ s.date = "2013-07-18"
13
+ s.description = "August Ash recipes for Capistrano"
14
+ s.email = "code@augustash.com"
15
+ s.extra_rdoc_files = [
16
+ "README.textile"
17
+ ]
18
+ s.files = [
19
+ "CHANGELOG.rdoc",
20
+ "README.textile",
21
+ "Rakefile",
22
+ "VERSION",
23
+ "capistrano-ash.gemspec",
24
+ "lib/ash/base.rb",
25
+ "lib/ash/common.rb",
26
+ "lib/ash/drupal.rb",
27
+ "lib/ash/drupal_shared_hosting.rb",
28
+ "lib/ash/hosted_magento.rb",
29
+ "lib/ash/magento.rb",
30
+ "lib/ash/wordpress.rb",
31
+ "lib/ash/wordpress_shared_hosting.rb",
32
+ "lib/ash/zend_doctrine.rb",
33
+ "lib/ash/zend_doctrine_shared_hosting.rb"
34
+ ]
35
+ s.homepage = "https://github.com/augustash/capistrano-ash"
36
+ s.require_paths = ["lib"]
37
+ s.rubygems_version = "2.0.3"
38
+ s.summary = "Useful task libraries for August Ash recipes for Capistrano"
39
+
40
+ if s.respond_to? :specification_version then
41
+ s.specification_version = 4
42
+
43
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
44
+ s.add_runtime_dependency(%q<capistrano>, [">= 2.12.0"])
45
+ s.add_runtime_dependency(%q<capistrano-ext>, [">= 0"])
46
+ s.add_runtime_dependency(%q<railsless-deploy>, [">= 0"])
47
+ s.add_runtime_dependency(%q<capistrano_colors>, [">= 0"])
48
+ else
49
+ s.add_dependency(%q<capistrano>, [">= 2.12.0"])
50
+ s.add_dependency(%q<capistrano-ext>, [">= 0"])
51
+ s.add_dependency(%q<railsless-deploy>, [">= 0"])
52
+ s.add_dependency(%q<capistrano_colors>, [">= 0"])
53
+ end
54
+ else
55
+ s.add_dependency(%q<capistrano>, [">= 2.12.0"])
56
+ s.add_dependency(%q<capistrano-ext>, [">= 0"])
57
+ s.add_dependency(%q<railsless-deploy>, [">= 0"])
58
+ s.add_dependency(%q<capistrano_colors>, [">= 0"])
59
+ end
60
+ end
61
+
data/lib/ash/base.rb CHANGED
@@ -43,7 +43,8 @@ configuration.load do
43
43
  # Source Control
44
44
  set :group_writable, false
45
45
  set :use_sudo, false
46
- set :scm, :subversion
46
+ set :scm, :git
47
+ set :git_enable_submodules, 1 if fetch(:scm, :git)
47
48
  set :scm_verbose, true
48
49
  set :scm_username, proc{text_prompt("Subversion username: ")}
49
50
  set :scm_password, proc{Capistrano::CLI.password_prompt("Subversion password for '#{scm_username}': ")}
@@ -107,8 +108,8 @@ configuration.load do
107
108
  task :setup, :except => { :no_release => true } do
108
109
  dirs = [deploy_to, releases_path, shared_path]
109
110
  dirs += shared_children.map { |d| File.join(shared_path, d.split('/').last) }
110
- run "#{try_sudo} mkdir -p #{dirs.join(' ')}"
111
- run "#{try_sudo} chmod 755 #{dirs.join(' ')}" if fetch(:group_writable, true)
111
+ try_sudo "mkdir -p #{dirs.join(' ')}"
112
+ try_sudo "chmod 755 #{dirs.join(' ')}" if fetch(:group_writable, true)
112
113
  end
113
114
 
114
115
  desc "Setup shared application directories and permissions after initial setup"
@@ -118,7 +119,7 @@ configuration.load do
118
119
 
119
120
  desc "Setup backup directory for database and web files"
120
121
  task :setup_backup, :except => { :no_release => true } do
121
- run "#{try_sudo} mkdir -p #{backups_path} #{tmp_backups_path} && #{try_sudo} chmod 755 #{backups_path}"
122
+ try_sudo "mkdir -p #{backups_path} #{tmp_backups_path} && chmod 755 #{backups_path}"
122
123
  end
123
124
 
124
125
  desc <<-DESC
@@ -416,16 +417,20 @@ configuration.load do
416
417
  else
417
418
  logger.info "keeping #{count} of #{backups.length} backups"
418
419
 
419
- archives = (backups - backups.last(count)).map { |backup|
420
- File.join(backups_path, backup) }.join(" ")
420
+ begin
421
+ archives = (backups - backups.last(count)).map { |backup|
422
+ File.join(backups_path, backup) }.join(" ")
421
423
 
422
- # fix permissions on the the files and directories before removing them
423
- archives.split(" ").each do |backup|
424
- set_perms_dirs("#{backup}", 755)
425
- set_perms_files("#{backup}", 644)
426
- end
424
+ # fix permissions on the the files and directories before removing them
425
+ archives.split(" ").each do |backup|
426
+ set_perms_dirs("#{backup}", 755)
427
+ set_perms_files("#{backup}", 644)
428
+ end
427
429
 
428
- try_sudo "rm -rf #{archives}"
430
+ try_sudo "rm -rf #{archives}"
431
+ rescue Exception => e
432
+ logger.important e.message
433
+ end
429
434
  end
430
435
  end
431
436
  end
@@ -458,7 +463,7 @@ configuration.load do
458
463
  logger.debug "trying to upload stylesheets from ./#{watched_dirs}/#{stylesheets_dir_name} -> #{latest_release}/#{watched_dirs}/#{stylesheets_dir_name}"
459
464
 
460
465
  servers.each do |web_server|
461
- upload_command = "scp -r ./#{watched_dirs}/#{stylesheets_dir_name}/*.css #{user}@#{web_server}:#{latest_release}/#{watched_dirs}/#{stylesheets_dir_name}/"
466
+ upload_command = "scp -r -P #{port} ./#{watched_dirs}/#{stylesheets_dir_name}/*.css #{user}@#{web_server}:#{latest_release}/#{watched_dirs}/#{stylesheets_dir_name}/"
462
467
 
463
468
  logger.info "running SCP command:"
464
469
  logger.debug upload_command
@@ -470,7 +475,7 @@ configuration.load do
470
475
  logger.debug "trying to upload stylesheets from ./#{dir}/#{stylesheets_dir_name}/ -> #{latest_release}/#{dir}/#{stylesheets_dir_name}/"
471
476
 
472
477
  servers.each do |web_server|
473
- upload_command = "scp -r ./#{dir}/#{stylesheets_dir_name}/*.css #{user}@#{web_server}:#{latest_release}/#{dir}/#{stylesheets_dir_name}/"
478
+ upload_command = "scp -r -P #{port} ./#{dir}/#{stylesheets_dir_name}/*.css #{user}@#{web_server}:#{latest_release}/#{dir}/#{stylesheets_dir_name}/"
474
479
 
475
480
  logger.info "running SCP command:"
476
481
  logger.debug upload_command
data/lib/ash/common.rb CHANGED
@@ -44,10 +44,10 @@ end
44
44
 
45
45
  # set the permissions for files recurisvely from the starting directory (dir_path)
46
46
  def set_perms_files(dir_path, perm = 644)
47
- try_sudo "find #{dir_path} -type f -exec chmod #{perm} {} \\;"
47
+ try_sudo "find #{dir_path} -type f -print0 | xargs -0 chmod #{perm}"
48
48
  end
49
49
 
50
50
  # set the permissions for directories recurisvely from the starting directory (dir_path)
51
51
  def set_perms_dirs(dir_path, perm = 755)
52
- try_sudo "find #{dir_path} -type d -exec chmod #{perm} {} \\;"
52
+ try_sudo "find #{dir_path} -type d -print0 | xargs -0 chmod #{perm}"
53
53
  end
data/lib/ash/drupal.rb CHANGED
@@ -8,6 +8,14 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
8
8
 
9
9
  configuration.load do
10
10
 
11
+ # --------------------------------------------
12
+ # Deployment dependencies
13
+ #
14
+ # $ cap <stage> deploy:check
15
+ #
16
+ # --------------------------------------------
17
+ depend :remote, :command, 'drush'
18
+
11
19
  # --------------------------------------------
12
20
  # Setting defaults
13
21
  # --------------------------------------------
@@ -55,17 +63,17 @@ configuration.load do
55
63
  desc "Setup shared application directories and permissions after initial setup"
56
64
  task :setup_shared do
57
65
  # remove Capistrano specific directories
58
- run "rm -Rf #{shared_path}/log"
59
- run "rm -Rf #{shared_path}/pids"
60
- run "rm -Rf #{shared_path}/system"
66
+ try_sudo "rm -Rf #{shared_path}/log"
67
+ try_sudo "rm -Rf #{shared_path}/pids"
68
+ try_sudo "rm -Rf #{shared_path}/system"
61
69
 
62
70
  # create shared directories
63
71
  multisites.each_pair do |folder, url|
64
- run "mkdir -p #{shared_path}/#{url}/files"
72
+ try_sudo "mkdir -p #{shared_path}/#{url}/files"
65
73
  end
66
74
 
67
75
  # set correct permissions
68
- run "chmod -R 777 #{shared_path}/*"
76
+ try_sudo "chmod -R 777 #{shared_path}/*"
69
77
  end
70
78
 
71
79
  desc "[internal] Touches up the released code. This is called by update_code after the basic deploy finishes."
@@ -73,9 +81,9 @@ configuration.load do
73
81
  # remove shared directories
74
82
  multisites.each_pair do |folder, url|
75
83
  if folder != url
76
- run "mv #{latest_release}/sites/#{folder} #{latest_release}/sites/#{url}"
84
+ try_sudo "mv #{latest_release}/sites/#{folder} #{latest_release}/sites/#{url}"
77
85
  end
78
- run "rm -Rf #{latest_release}/sites/#{url}/files"
86
+ try_sudo "rm -Rf #{latest_release}/sites/#{url}/files"
79
87
  end
80
88
  end
81
89
 
@@ -144,7 +152,7 @@ configuration.load do
144
152
  # symlinks the appropriate environment's settings.php file
145
153
  symlink_config_file
146
154
 
147
- run "ln -nfs #{shared_path}/#{url}/files #{latest_release}/sites/#{url}/files"
155
+ try_sudo "ln -nfs #{shared_path}/#{url}/files #{latest_release}/sites/#{url}/files"
148
156
  run "#{drush_bin} -l #{url} -r #{current_path} vset --yes file_directory_path sites/#{url}/files"
149
157
  end
150
158
  end
@@ -188,7 +196,7 @@ configuration.load do
188
196
  desc "Protect system files"
189
197
  task :protect, :roles => :web, :except => { :no_release => true } do
190
198
  multisites.each_pair do |folder, url|
191
- run "chmod 644 #{latest_release}/sites/#{url}/settings.php*"
199
+ try_sudo "chmod 644 #{latest_release}/sites/#{url}/settings.php*"
192
200
  end
193
201
  end
194
202
 
@@ -220,7 +228,7 @@ configuration.load do
220
228
  DESC
221
229
  task :setup_ubercart_shared, :roles => :web, :except => { :no_release => true } do
222
230
  multisites.each_pair do |folder, url|
223
- run "mkdir -p #{shared_path}/#{url}/#{uc_root}"
231
+ try_sudo "mkdir -p #{shared_path}/#{url}/#{uc_root}"
224
232
  end
225
233
  end
226
234
 
@@ -239,13 +247,13 @@ configuration.load do
239
247
  task :secure_downloadable_files, :except => { :no_release => true } do
240
248
  # loop through the multisites and move files
241
249
  multisites.each_pair do |folder, url|
242
- run "mkdir -p #{shared_path}/#{url}/#{uc_root}/#{uc_downloadable_products_root}"
250
+ try_sudo "mkdir -p #{shared_path}/#{url}/#{uc_root}/#{uc_downloadable_products_root}"
243
251
 
244
252
  ubercart_dir = "#{latest_release}/sites/#{url}/files/#{uc_root}/#{uc_downloadable_products_root}"
245
253
 
246
254
  case true
247
255
  when remote_dir_exists?("#{ubercart_dir}")
248
- run "rsync -rltDvzog #{ubercart_dir} #{shared_path}/#{url}/#{uc_root}/#{uc_downloadable_products_root}"
256
+ try_sudo "rsync -rltDvzog #{ubercart_dir} #{shared_path}/#{url}/#{uc_root}/#{uc_downloadable_products_root}"
249
257
  else
250
258
  logger.important "Failed to rsync the ubercart downloadable products in #{ubercart_dir} because the directory doesn't exist"
251
259
  end
@@ -273,7 +281,7 @@ configuration.load do
273
281
  task :secure_encryption_key, :roles => :web, :except => { :no_release => true } do
274
282
  # loop through the multisites and move keys
275
283
  multisites.each_pair do |folder, url|
276
- run "mkdir -p #{shared_path}/#{url}/#{uc_root}/#{uc_encryption_keys_root}"
284
+ try_sudo "mkdir -p #{shared_path}/#{url}/#{uc_root}/#{uc_encryption_keys_root}"
277
285
 
278
286
  # update the ubercart's database tracking of where the
279
287
  # root file path is for encryption keys. This should
@@ -6,6 +6,11 @@ configuration = Capistrano::Configuration.respond_to?(:instance) ?
6
6
  Capistrano.configuration(:must_exist)
7
7
 
8
8
  configuration.load do
9
+
10
+ # shared servers typically don't allow `sudo`,
11
+ # so this will tell `try_sudo` to run as the `:user` instead
12
+ set :use_sudo, false
13
+
9
14
  # --------------------------------------------
10
15
  # Overloaded Methods
11
16
  # --------------------------------------------
@@ -26,4 +31,4 @@ configuration.load do
26
31
  set_perms_dirs("#{shared_path}")
27
32
  end
28
33
  end
29
- end
34
+ end
@@ -13,12 +13,11 @@ configuration.load do
13
13
  # --------------------------------------------
14
14
  after "deploy:setup", "deploy:setup_shared"
15
15
  after "deploy:finalize_update", "ash:fixperms"
16
- # after "deploy:create_symlink", "zend:symlink"
17
16
 
18
17
  # workaround for issues with capistrano v2.13.3 and
19
18
  # before/after callbacks not firing for 'deploy:symlink'
20
19
  # or 'deploy:create_symlink'
21
- after "deploy", "zend:symlink"
20
+ after "deploy:create_symlink", "zend:symlink"
22
21
  after "zend:symlink", "compass"
23
22
  after "deploy", "deploy:cleanup"
24
23
 
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-ash
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
5
- prerelease:
4
+ version: 1.3.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - August Ash
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-18 00:00:00.000000000 Z
11
+ date: 2013-07-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: capistrano
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ! '>='
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ! '>='
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: capistrano-ext
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: railsless-deploy
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: capistrano_colors
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -86,6 +77,7 @@ files:
86
77
  - README.textile
87
78
  - Rakefile
88
79
  - VERSION
80
+ - capistrano-ash.gemspec
89
81
  - lib/ash/base.rb
90
82
  - lib/ash/common.rb
91
83
  - lib/ash/drupal.rb
@@ -98,26 +90,25 @@ files:
98
90
  - lib/ash/zend_doctrine_shared_hosting.rb
99
91
  homepage: https://github.com/augustash/capistrano-ash
100
92
  licenses: []
93
+ metadata: {}
101
94
  post_install_message:
102
95
  rdoc_options: []
103
96
  require_paths:
104
97
  - lib
105
98
  required_ruby_version: !ruby/object:Gem::Requirement
106
- none: false
107
99
  requirements:
108
100
  - - ! '>='
109
101
  - !ruby/object:Gem::Version
110
102
  version: '0'
111
103
  required_rubygems_version: !ruby/object:Gem::Requirement
112
- none: false
113
104
  requirements:
114
105
  - - ! '>='
115
106
  - !ruby/object:Gem::Version
116
107
  version: '0'
117
108
  requirements: []
118
109
  rubyforge_project:
119
- rubygems_version: 1.8.24
110
+ rubygems_version: 2.0.3
120
111
  signing_key:
121
- specification_version: 3
112
+ specification_version: 4
122
113
  summary: Useful task libraries for August Ash recipes for Capistrano
123
114
  test_files: []