capistrano-demonz 0.0.15 → 0.0.16

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.md CHANGED
@@ -1,6 +1,10 @@
1
- **Current version:** 0.0.15
1
+ **Current version:** 0.0.16
2
2
 
3
3
  ## Changes ##
4
+ ### 0.0.16 ###
5
+ * Fixed critical issue where cleanup script was deleting the _newest_ version instead of the _oldest_ one.
6
+ * The release delete function wasn't actually joining arrays with newline separators.
7
+
4
8
  ### 0.0.15 ###
5
9
  * Fixed issue where update script could sometimes not have enough permission to run.
6
10
 
data/README.md CHANGED
@@ -106,6 +106,12 @@ Additionally, if this is a fresh deployment, the script will prompt you for a gz
106
106
 
107
107
  $ drush sql-dump --result-file --gzip
108
108
 
109
+ Deployment will run, if available, a specific release script located here `/var/www/mysite.com/releases/<mygittag>/sites/all/scripts/<mygittag>/update.sh`
110
+
111
+ To delete completely a delivered release:
112
+
113
+ $ cap deploy:delete_release RELEASE='mygittag'
114
+
109
115
  And that's it!
110
116
 
111
117
  ## Contributing
data/lib/demonz/base.rb CHANGED
@@ -127,7 +127,7 @@ configuration.load do
127
127
  DESC
128
128
  task :cleanup, :except => { :no_release => true } do
129
129
  count = fetch(:keep_releases, 5).to_i
130
- local_releases = get_release_history(release_file).split.reverse
130
+ local_releases = get_release_history(release_file).split
131
131
  if count >= local_releases.length
132
132
  logger.important "no old releases to clean up"
133
133
  else
data/lib/demonz/common.rb CHANGED
@@ -56,8 +56,8 @@ def remove_release_from_history(release, release_file)
56
56
  release_history.delete_at release_history.index(release) unless release_history.index(release).nil?
57
57
 
58
58
  # Save
59
- release_history.join("\n")
60
- try_sudo "echo #{release_history} > #{release_file}"
59
+ release_history = release_history.join("\n")
60
+ try_sudo "printf #{release_history} > #{release_file}"
61
61
  end
62
62
 
63
63
  # Get the database name given an application and release name
data/lib/demonz/drupal.rb CHANGED
@@ -109,7 +109,7 @@ configuration.load do
109
109
  # Backup files dir.
110
110
  removed_files_bak = File.join(tmp_backups_path, "#{removed_release}.files.tar.gz")
111
111
  files_dir_location = File.join(shared_path, 'default')
112
- run "cd #{files_dir_location} && tar -cvpf - files | #{try_sudo} gzip -c --best > #{removed_files_bak}"
112
+ run "cd #{files_dir_location} && tar -cpf - files | #{try_sudo} gzip -c --best > #{removed_files_bak}"
113
113
  logger.info "files directory backed up"
114
114
 
115
115
  # Update 'current' symlink to previous release if removing latest.
@@ -124,7 +124,7 @@ configuration.load do
124
124
  previous_files_bak = File.join(backups_path, "files_before_#{removed_release}.tar.gz")
125
125
  if remote_file_exists?(previous_files_bak)
126
126
  logger.info "restoring previous files backup"
127
- run "cd #{files_dir_location} && #{try_sudo} tar -xvpzf #{previous_files_bak}"
127
+ run "cd #{files_dir_location} && #{try_sudo} tar -xpzf #{previous_files_bak}"
128
128
  end
129
129
  end
130
130
  end
@@ -259,8 +259,8 @@ configuration.load do
259
259
 
260
260
  if remote_file_exists?(update_script_file)
261
261
  # Make sure script is executable.
262
- run "#{try_sudo} chmod go+x #{update_script_file}"
263
- run "cd #{latest_release} && #{try_sudo} #{update_script_file}"
262
+ run "#{try_sudo} chmod ug+x #{update_script_file}"
263
+ run "cd #{latest_release} && #{update_script_file}"
264
264
  end
265
265
  end
266
266
 
@@ -325,7 +325,7 @@ configuration.load do
325
325
  compile_sass if uses_sass
326
326
 
327
327
  # Run drush updb just incase
328
- run "#{drush_bin} -r #{latest_release} updb"
328
+ run "#{drush_bin} -r #{latest_release} updb -y"
329
329
  end
330
330
 
331
331
  desc "Backup the shared 'files' directory"
@@ -333,7 +333,7 @@ configuration.load do
333
333
  set :archive_name, "files_before_#{release_name}.tar.gz"
334
334
  set :files_dir_location, File.join(shared_path, 'default')
335
335
  logger.debug "Creating a Tarball of the files directory in #{backups_path}/#{archive_name}"
336
- run "cd #{files_dir_location} && tar -cvpf - files | #{try_sudo} gzip -c --best > #{backups_path}/#{archive_name}"
336
+ run "cd #{files_dir_location} && tar -cpf - files | #{try_sudo} gzip -c --best > #{backups_path}/#{archive_name}"
337
337
  end
338
338
 
339
339
  desc "Clear all Drupal cache"
@@ -376,11 +376,11 @@ configuration.load do
376
376
 
377
377
  on_rollback {
378
378
  run "#{try_sudo} rm #{files_dir}" if remote_file_exists?(files_dir_backup_archive) && remote_dir_exists?(files_dir)
379
- run "#{try_sudo} tar -xvzf #{files_dir_backup_archive} -C #{files_dir_location}" if remote_file_exists?(files_dir_backup_archive)
379
+ run "#{try_sudo} tar -xzf #{files_dir_backup_archive} -C #{files_dir_location}" if remote_file_exists?(files_dir_backup_archive)
380
380
  }
381
381
 
382
- run "cd #{files_dir_location} && tar -cvpf - files | gzip -c --best > #{backups_path}/#{files_dir_backup_archive}"
383
- run "#{try_sudo} tar -xvzf #{files_backup_file} -C #{files_dir_location}"
382
+ run "cd #{files_dir_location} && tar -cpf - files | gzip -c --best > #{backups_path}/#{files_dir_backup_archive}"
383
+ run "#{try_sudo} tar -xzf #{files_backup_file} -C #{files_dir_location}"
384
384
  end
385
385
  else
386
386
  abort "could not rollback the code because there is no prior release"
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Demonz
3
- VERSION = "0.0.15"
3
+ VERSION = "0.0.16"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-demonz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
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: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railsless-deploy
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  version: '0'
84
84
  requirements: []
85
85
  rubyforge_project:
86
- rubygems_version: 1.8.24
86
+ rubygems_version: 1.8.25
87
87
  signing_key:
88
88
  specification_version: 3
89
89
  summary: Useful task libraries for Demonz Media recipes for Capistrano