capistrano-ash 1.1.18 → 1.1.19
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/VERSION +1 -1
- data/capistrano-ash.gemspec +2 -2
- data/lib/ash/base.rb +41 -5
- data/lib/ash/drupal_shared_hosting.rb +1 -1
- metadata +19 -27
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.19
|
data/capistrano-ash.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "capistrano-ash"
|
8
|
-
s.version = "1.1.
|
8
|
+
s.version = "1.1.17"
|
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 = "2012-04-
|
12
|
+
s.date = "2012-04-06"
|
13
13
|
s.description = "August Ash recipes for Capistrano"
|
14
14
|
s.email = "code@augustash.com"
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/ash/base.rb
CHANGED
@@ -107,7 +107,7 @@ configuration.load do
|
|
107
107
|
run "#{try_sudo} mkdir -p #{dirs.join(' ')}"
|
108
108
|
run "#{try_sudo} chmod 755 #{dirs.join(' ')}" if fetch(:group_writable, true)
|
109
109
|
end
|
110
|
-
|
110
|
+
|
111
111
|
desc "Setup shared application directories and permissions after initial setup"
|
112
112
|
task :setup_shared do
|
113
113
|
puts "STUB: Setup"
|
@@ -117,6 +117,35 @@ configuration.load do
|
|
117
117
|
task :setup_backup, :except => { :no_release => true } do
|
118
118
|
run "#{try_sudo} mkdir -p #{backups_path} #{tmp_backups_path} && #{try_sudo} chmod 755 #{backups_path}"
|
119
119
|
end
|
120
|
+
|
121
|
+
|
122
|
+
desc <<-DESC
|
123
|
+
Clean up old releases. By default, the last 5 releases are kept on each \
|
124
|
+
server (though you can change this with the keep_releases variable). All \
|
125
|
+
other deployed revisions are removed from the servers. By default, this \
|
126
|
+
will use sudo to clean up the old releases, but if sudo is not available \
|
127
|
+
for your environment, set the :use_sudo variable to false instead. \
|
128
|
+
|
129
|
+
Overridden to set/reset file and directory permissions
|
130
|
+
DESC
|
131
|
+
task :cleanup, :except => { :no_release => true } do
|
132
|
+
count = fetch(:keep_releases, 5).to_i
|
133
|
+
local_releases = capture("ls -xt #{releases_path}").split.reverse
|
134
|
+
if count >= local_releases.length
|
135
|
+
logger.important "no old releases to clean up"
|
136
|
+
else
|
137
|
+
logger.info "keeping #{count} of #{local_releases.length} deployed releases"
|
138
|
+
directories = (local_releases - local_releases.last(count)).map { |release|
|
139
|
+
File.join(releases_path, release) }.join(" ")
|
140
|
+
|
141
|
+
directories.each do |dir|
|
142
|
+
set_perms_dirs(dir)
|
143
|
+
set_perms_files(dir)
|
144
|
+
end
|
145
|
+
|
146
|
+
try_sudo "rm -rf #{directories}"
|
147
|
+
end
|
148
|
+
end
|
120
149
|
end
|
121
150
|
|
122
151
|
# --------------------------------------------
|
@@ -205,7 +234,7 @@ configuration.load do
|
|
205
234
|
task :local_export do
|
206
235
|
mysqldump = fetch(:mysqldump, "mysqldump")
|
207
236
|
dump_options = fetch(:dump_options, "--single-transaction --create-options --quick")
|
208
|
-
|
237
|
+
|
209
238
|
system "#{mysqldump} #{dump_options} --opt -h#{db_local_host} -u#{db_local_user} -p#{db_local_pass} #{db_local_name} | gzip -c --best > #{db_local_name}.sql.gz"
|
210
239
|
end
|
211
240
|
|
@@ -238,7 +267,7 @@ configuration.load do
|
|
238
267
|
task :remote_export, :roles => :db do
|
239
268
|
mysqldump = fetch(:mysqldump, "mysqldump")
|
240
269
|
dump_options = fetch(:dump_options, "--single-transaction --create-options --quick")
|
241
|
-
|
270
|
+
|
242
271
|
run "#{mysqldump} #{dump_options} --opt -h#{db_remote_host} -u#{db_remote_user} -p#{db_remote_pass} #{db_remote_name} | gzip -c --best > #{deploy_to}/#{db_remote_name}.sql.gz"
|
243
272
|
end
|
244
273
|
|
@@ -312,6 +341,13 @@ configuration.load do
|
|
312
341
|
# Copy the previous release to the /tmp directory
|
313
342
|
logger.debug "Copying previous release to the #{tmp_backups_path}/#{release_name} directory"
|
314
343
|
run "rsync -avzrtpL #{exclude_string} #{current_path}/ #{tmp_backups_path}/#{release_name}/"
|
344
|
+
|
345
|
+
# --------------------------
|
346
|
+
# SET/RESET PERMISSIONS
|
347
|
+
# --------------------------
|
348
|
+
set_perms_dirs("#{tmp_backups_path}/#{release_name}", 755)
|
349
|
+
set_perms_files("#{tmp_backups_path}/#{release_name}", 644)
|
350
|
+
|
315
351
|
# create the tarball of the previous release
|
316
352
|
set :archive_name, "release_B4_#{release_name}.tar.gz"
|
317
353
|
logger.debug "Creating a Tarball of the previous release in #{backups_path}/#{archive_name}"
|
@@ -330,7 +366,7 @@ configuration.load do
|
|
330
366
|
if previous_release
|
331
367
|
mysqldump = fetch(:mysqldump, "mysqldump")
|
332
368
|
dump_options = fetch(:dump_options, "--single-transaction --create-options --quick")
|
333
|
-
|
369
|
+
|
334
370
|
puts "Backing up the database now and putting dump file in the previous release directory"
|
335
371
|
# define the filename (include the current_path so the dump file will be within the directory)
|
336
372
|
filename = "#{current_path}/#{dbname}_dump-#{Time.now.to_s.gsub(/ /, "_")}.sql.gz"
|
@@ -365,7 +401,7 @@ configuration.load do
|
|
365
401
|
set_perms_dirs("#{backup}", 755)
|
366
402
|
set_perms_files("#{backup}", 644)
|
367
403
|
end
|
368
|
-
|
404
|
+
|
369
405
|
try_sudo "rm -rf #{archives}"
|
370
406
|
end
|
371
407
|
end
|
metadata
CHANGED
@@ -1,27 +1,23 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-ash
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.19
|
4
5
|
prerelease:
|
5
|
-
version: 1.1.18
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- August Ash
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-04-11 00:00:00 Z
|
12
|
+
date: 2012-08-09 00:00:00.000000000 Z
|
14
13
|
dependencies: []
|
15
|
-
|
16
14
|
description: August Ash recipes for Capistrano
|
17
15
|
email: code@augustash.com
|
18
16
|
executables: []
|
19
|
-
|
20
17
|
extensions: []
|
21
|
-
|
22
|
-
extra_rdoc_files:
|
18
|
+
extra_rdoc_files:
|
23
19
|
- README.textile
|
24
|
-
files:
|
20
|
+
files:
|
25
21
|
- CHANGELOG.rdoc
|
26
22
|
- README.textile
|
27
23
|
- Rakefile
|
@@ -39,30 +35,26 @@ files:
|
|
39
35
|
- lib/ash/zend_doctrine_shared_hosting.rb
|
40
36
|
homepage: https://github.com/augustash/capistrano-ash
|
41
37
|
licenses: []
|
42
|
-
|
43
38
|
post_install_message:
|
44
39
|
rdoc_options: []
|
45
|
-
|
46
|
-
require_paths:
|
40
|
+
require_paths:
|
47
41
|
- lib
|
48
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
42
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
43
|
none: false
|
50
|
-
requirements:
|
51
|
-
- -
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version:
|
54
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
49
|
none: false
|
56
|
-
requirements:
|
57
|
-
- -
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
version:
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
60
54
|
requirements: []
|
61
|
-
|
62
55
|
rubyforge_project:
|
63
|
-
rubygems_version: 1.8.
|
56
|
+
rubygems_version: 1.8.23
|
64
57
|
signing_key:
|
65
58
|
specification_version: 3
|
66
59
|
summary: Useful task libraries for August Ash recipes for Capistrano
|
67
60
|
test_files: []
|
68
|
-
|