dkdeploy-core 9.0.1 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -9
- data/README.md +1 -1
- data/dkdeploy-core.gemspec +1 -1
- data/lib/dkdeploy/core/version.rb +2 -2
- data/lib/dkdeploy/dsl.rb +2 -3
- data/lib/dkdeploy/scm/copy.rake +38 -13
- data/lib/dkdeploy/scm/copy.rb +5 -45
- data/lib/dkdeploy/tasks/db.rake +4 -5
- data/lib/dkdeploy/tasks/deploy.rake +2 -3
- data/lib/dkdeploy/tasks/maintenance.rake +0 -1
- metadata +9 -9
- data/lib/capistrano/copy.rb +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01de919730c9238f0ddf22089d566239031ab4e4a5c764b6b936fbaee5790398
|
4
|
+
data.tar.gz: 7797adbab2d5eb3e6623b4317a6c493605e16e14cf59997576e24e1ecd83b9f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7a49cc2454cff2cd4b86aba5829ba4ece9b18b052056abd31504a963c7fd8f548b9f8f94f7de00974d3659cc76191c54a7566aaa272dd76cd86813fe93e45ab
|
7
|
+
data.tar.gz: '09189290d051c2d6fe873e4f24c474b206f575eb950d8643404105ee6d581f0c192a9fc6f4a1763fe8c8396a61f77c4286a7b968bc47f6c83f10b2c9d3dcd5b9'
|
data/CHANGELOG.md
CHANGED
@@ -2,10 +2,12 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
-
## [9.0
|
5
|
+
## [9.1.0]
|
6
6
|
### Summary
|
7
7
|
|
8
|
-
-
|
8
|
+
- Use correct capistrano context at copy scm
|
9
|
+
- Update capistrano 3.10.1
|
10
|
+
- Always execute tasks for each server or at rollback
|
9
11
|
|
10
12
|
## [9.0.0]
|
11
13
|
### Summary
|
@@ -27,11 +29,6 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
27
29
|
- remove TYPO3 specific configuration
|
28
30
|
- change some SCM roles from app to all
|
29
31
|
|
30
|
-
## [8.0.2] - 2020-08-21
|
31
|
-
### Summary
|
32
|
-
|
33
|
-
- use --no-tablespaces with mysqldump
|
34
|
-
|
35
32
|
## [8.0.1] - 2017-05-15
|
36
33
|
### Summary
|
37
34
|
|
@@ -43,8 +40,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
43
40
|
- first public release
|
44
41
|
|
45
42
|
[Unreleased]: https://github.com/dkdeploy/dkdeploy-core/compare/master...develop
|
46
|
-
[9.0
|
43
|
+
[9.1.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v9.1.0
|
47
44
|
[9.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v9.0.0
|
48
|
-
[8.0.2]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.2
|
49
45
|
[8.0.1]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.1
|
50
46
|
[8.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.0
|
data/README.md
CHANGED
data/dkdeploy-core.gemspec
CHANGED
@@ -28,6 +28,6 @@ Gem::Specification.new do |spec|
|
|
28
28
|
spec.add_development_dependency 'pry', '~> 0.10'
|
29
29
|
spec.add_development_dependency 'dkdeploy-test_environment', '~> 2.0'
|
30
30
|
|
31
|
-
spec.add_dependency 'capistrano', '~> 3.
|
31
|
+
spec.add_dependency 'capistrano', '~> 3.10.1'
|
32
32
|
spec.add_dependency 'highline', '~> 1.7.1'
|
33
33
|
end
|
data/lib/dkdeploy/dsl.rb
CHANGED
@@ -6,15 +6,14 @@ module Dkdeploy
|
|
6
6
|
# @param server [Capistrano::Configuration::Server] Server to execute task
|
7
7
|
# @param task [String] Name of rake/capistrano task
|
8
8
|
# @param args [Array] Arguments of rake/capistrano task
|
9
|
-
def invoke_for_server(server, task, *args)
|
9
|
+
def invoke_for_server(server, task, *args)
|
10
10
|
backup_filter = fetch :filter, {}
|
11
11
|
new_server_filter = Marshal.load(Marshal.dump(backup_filter))
|
12
12
|
new_server_filter[:host] = server.hostname
|
13
13
|
set :filter, new_server_filter
|
14
14
|
env.setup_filters
|
15
15
|
info I18n.t('dsl.invoke_for_server.set_filter', task: task, host: server.hostname, scope: :dkdeploy)
|
16
|
-
invoke task, *args
|
17
|
-
Rake::Task[task].reenable
|
16
|
+
invoke! task, *args
|
18
17
|
ensure
|
19
18
|
set :filter, backup_filter
|
20
19
|
env.setup_filters
|
data/lib/dkdeploy/scm/copy.rake
CHANGED
@@ -1,6 +1,3 @@
|
|
1
|
-
# This trick lets us access the copy plugin within `on` blocks.
|
2
|
-
copy_plugin = self
|
3
|
-
|
4
1
|
namespace :copy do
|
5
2
|
desc 'Check if all configuration variables and copy sources exist'
|
6
3
|
task :check do
|
@@ -24,11 +21,11 @@ namespace :copy do
|
|
24
21
|
|
25
22
|
# generate an exclude.txt file with the patterns to be excluded
|
26
23
|
exclude_content = copy_exclude.join("\n")
|
27
|
-
File.write(
|
24
|
+
File.write(local_exclude_path, exclude_content)
|
28
25
|
|
29
26
|
# build the tar archive excluding the patterns from exclude.txt
|
30
27
|
within copy_source do
|
31
|
-
execute :tar, '-X ' +
|
28
|
+
execute :tar, '-X ' + local_exclude_path, '-cpzf', local_archive_path, '.'
|
32
29
|
end
|
33
30
|
end
|
34
31
|
end
|
@@ -38,17 +35,17 @@ namespace :copy do
|
|
38
35
|
#
|
39
36
|
task :copy_archive_to_server do
|
40
37
|
on release_roles :all do
|
41
|
-
info I18n.t('file.upload', file: 'archive', target:
|
42
|
-
execute :mkdir, '-p',
|
38
|
+
info I18n.t('file.upload', file: 'archive', target: remote_tmp_dir, scope: :dkdeploy)
|
39
|
+
execute :mkdir, '-p', remote_tmp_dir
|
43
40
|
|
44
|
-
upload!
|
41
|
+
upload! local_archive_path, remote_tmp_dir
|
45
42
|
|
46
43
|
info I18n.t('directory.create', directory: release_path, scope: :dkdeploy)
|
47
44
|
execute :mkdir, '-p', release_path
|
48
45
|
|
49
46
|
within release_path do
|
50
47
|
info I18n.t('tasks.copy.archive.extract', target: release_path, scope: :dkdeploy)
|
51
|
-
execute :tar, '-xpzf',
|
48
|
+
execute :tar, '-xpzf', remote_archive_path
|
52
49
|
end
|
53
50
|
end
|
54
51
|
end
|
@@ -58,14 +55,14 @@ namespace :copy do
|
|
58
55
|
task :clean_up_temporary_sources do
|
59
56
|
# remove the local temporary directory
|
60
57
|
run_locally do
|
61
|
-
info I18n.t('file.remove', path:
|
62
|
-
execute :rm, '-rf',
|
58
|
+
info I18n.t('file.remove', path: fetch(:copy_local_tmp_dir), scope: :dkdeploy)
|
59
|
+
execute :rm, '-rf', fetch(:copy_local_tmp_dir)
|
63
60
|
end
|
64
61
|
|
65
62
|
# removes the remote temp path including the uploaded archive
|
66
63
|
on release_roles :all do
|
67
|
-
info I18n.t('file.remove', path:
|
68
|
-
execute :rm, '-rf',
|
64
|
+
info I18n.t('file.remove', path: remote_archive_path, scope: :dkdeploy)
|
65
|
+
execute :rm, '-rf', remote_tmp_dir
|
69
66
|
end
|
70
67
|
end
|
71
68
|
|
@@ -73,4 +70,32 @@ namespace :copy do
|
|
73
70
|
task :set_current_revision do
|
74
71
|
set :current_revision, I18n.t('log.revision_log_message', copy_source: fetch(:copy_source), time: Time.now, scope: :dkdeploy)
|
75
72
|
end
|
73
|
+
|
74
|
+
# Archive path in a local temporary directory
|
75
|
+
#
|
76
|
+
# @return [String]
|
77
|
+
def local_exclude_path
|
78
|
+
File.join fetch(:copy_local_tmp_dir), 'exclude.txt'
|
79
|
+
end
|
80
|
+
|
81
|
+
# Archive path in a local temporary directory
|
82
|
+
#
|
83
|
+
# @return [String]
|
84
|
+
def local_archive_path
|
85
|
+
File.join fetch(:copy_local_tmp_dir), fetch(:copy_archive_filename)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Remote temporary directory path
|
89
|
+
#
|
90
|
+
# @return [String]
|
91
|
+
def remote_tmp_dir
|
92
|
+
File.join fetch(:tmp_dir), application
|
93
|
+
end
|
94
|
+
|
95
|
+
# Archive path in a remote temporary directory
|
96
|
+
#
|
97
|
+
# @return [String]
|
98
|
+
def remote_archive_path
|
99
|
+
File.join remote_tmp_dir, fetch(:copy_archive_filename)
|
100
|
+
end
|
76
101
|
end
|
data/lib/dkdeploy/scm/copy.rb
CHANGED
@@ -25,6 +25,8 @@ module Dkdeploy
|
|
25
25
|
'Thumbs.db',
|
26
26
|
'composer.lock'
|
27
27
|
]
|
28
|
+
set_if_empty :copy_archive_filename, -> { Dir::Tmpname.make_tmpname([fetch(:application) + '_', '.tar.gz'], nil) }
|
29
|
+
set_if_empty :copy_local_tmp_dir, Dir.mktmpdir
|
28
30
|
end
|
29
31
|
|
30
32
|
def register_hooks
|
@@ -34,51 +36,9 @@ module Dkdeploy
|
|
34
36
|
end
|
35
37
|
|
36
38
|
def define_tasks
|
37
|
-
eval_rakefile
|
38
|
-
|
39
|
-
|
40
|
-
# Archive filename as singleton
|
41
|
-
# Note: if the archive filename doesn't already exist it will be generated
|
42
|
-
#
|
43
|
-
# @return [String]
|
44
|
-
def archive_filename
|
45
|
-
@archive_filename ||= Dir::Tmpname.make_tmpname [application + '_', '.tar.gz'], nil
|
46
|
-
end
|
47
|
-
|
48
|
-
# Local temporary directory path as singleton
|
49
|
-
# Note: if the directory doesn't already exist it will be created
|
50
|
-
#
|
51
|
-
# @return [String]
|
52
|
-
def local_tmp_dir
|
53
|
-
@local_tmp_dir ||= Dir.mktmpdir
|
54
|
-
end
|
55
|
-
|
56
|
-
# Archive path in a local temporary directory
|
57
|
-
#
|
58
|
-
# @return [String]
|
59
|
-
def local_exclude_path
|
60
|
-
File.join local_tmp_dir, 'exclude.txt'
|
61
|
-
end
|
62
|
-
|
63
|
-
# Archive path in a local temporary directory
|
64
|
-
#
|
65
|
-
# @return [String]
|
66
|
-
def local_archive_path
|
67
|
-
File.join local_tmp_dir, archive_filename
|
68
|
-
end
|
69
|
-
|
70
|
-
# Remote temporary directory path
|
71
|
-
#
|
72
|
-
# @return [String]
|
73
|
-
def remote_tmp_dir
|
74
|
-
File.join fetch(:tmp_dir), application
|
75
|
-
end
|
76
|
-
|
77
|
-
# Archive path in a remote temporary directory
|
78
|
-
#
|
79
|
-
# @return [String]
|
80
|
-
def remote_archive_path
|
81
|
-
File.join remote_tmp_dir, archive_filename
|
39
|
+
# Don not use method "eval_rakefile" to load rake tasks.
|
40
|
+
# "eval_rakefile" defined wrong context and use sskit dsl api instead of capistrano dsl.
|
41
|
+
load File.expand_path('../copy.rake', __FILE__)
|
82
42
|
end
|
83
43
|
end
|
84
44
|
end
|
data/lib/dkdeploy/tasks/db.rake
CHANGED
@@ -115,7 +115,7 @@ namespace :db do
|
|
115
115
|
execute :rm, '-f', remote_dump_file
|
116
116
|
execute :rm, '-f', remote_zipped_dump_file
|
117
117
|
execute :mysqldump,
|
118
|
-
'--no-data', '--skip-set-charset',
|
118
|
+
'--no-data', '--skip-set-charset',
|
119
119
|
"--default-character-set=#{db_settings.fetch('charset')}",
|
120
120
|
'-u', db_settings.fetch('username'),
|
121
121
|
'-p',
|
@@ -150,7 +150,6 @@ namespace :db do
|
|
150
150
|
execute :mysqldump,
|
151
151
|
"--default-character-set=#{db_settings.fetch('charset')}",
|
152
152
|
'--skip-set-charset',
|
153
|
-
'--no-tablespaces',
|
154
153
|
'-u', db_settings.fetch('username'),
|
155
154
|
'-p',
|
156
155
|
'-h', db_settings.fetch('host'), '-P', db_settings.fetch('port'), ignore_tables_command_line, db_settings.fetch('name'),
|
@@ -180,7 +179,7 @@ namespace :db do
|
|
180
179
|
execute :rm, '-f', remote_dump_file
|
181
180
|
execute :rm, '-f', remote_zipped_dump_file
|
182
181
|
execute :mysqldump,
|
183
|
-
'--no-data', '--skip-set-charset',
|
182
|
+
'--no-data', '--skip-set-charset',
|
184
183
|
"--default-character-set=#{db_settings.fetch('charset')}",
|
185
184
|
'-u', db_settings.fetch('username'),
|
186
185
|
'-p',
|
@@ -215,7 +214,7 @@ namespace :db do
|
|
215
214
|
execute :rm, '-f', remote_file_name
|
216
215
|
execute :rm, '-f', remote_zipped_file
|
217
216
|
execute :mysqldump,
|
218
|
-
'--no-data', '--skip-set-charset',
|
217
|
+
'--no-data', '--skip-set-charset',
|
219
218
|
'--no-create-info', '--skip-comments',
|
220
219
|
'--skip-extended-insert', '--skip-set-charset',
|
221
220
|
"--default-character-set=#{db_settings.fetch('charset')}",
|
@@ -314,7 +313,7 @@ namespace :db do
|
|
314
313
|
"--default-character-set=#{db_settings.fetch('charset')}",
|
315
314
|
'--no-create-info', '--skip-comments',
|
316
315
|
'--skip-extended-insert', '--skip-set-charset',
|
317
|
-
'--complete-insert',
|
316
|
+
'--complete-insert',
|
318
317
|
'-u', db_settings.fetch('username'),
|
319
318
|
'-p',
|
320
319
|
'-h', db_settings.fetch('host'), '-P', db_settings.fetch('port'),
|
@@ -22,7 +22,7 @@ namespace :deploy do
|
|
22
22
|
end
|
23
23
|
end
|
24
24
|
# Backup and remove last release
|
25
|
-
invoke 'deploy:cleanup_rollback'
|
25
|
+
invoke! 'deploy:cleanup_rollback'
|
26
26
|
|
27
27
|
run_locally do
|
28
28
|
error I18n.t('rollback_tasks', tasks_for_rollback: tasks_for_rollback.join(', '), scope: :dkdeploy) unless tasks_for_rollback.empty?
|
@@ -33,8 +33,7 @@ namespace :deploy do
|
|
33
33
|
next unless Rake::Task.task_defined? task_name
|
34
34
|
|
35
35
|
# call rollback task
|
36
|
-
|
37
|
-
invoke task_name
|
36
|
+
invoke! task_name
|
38
37
|
end
|
39
38
|
|
40
39
|
run_locally do
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dkdeploy-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 9.0
|
4
|
+
version: 9.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Timo Webler
|
8
8
|
- Nicolai Reuschling
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2018-02-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -143,14 +143,14 @@ dependencies:
|
|
143
143
|
requirements:
|
144
144
|
- - "~>"
|
145
145
|
- !ruby/object:Gem::Version
|
146
|
-
version: 3.
|
146
|
+
version: 3.10.1
|
147
147
|
type: :runtime
|
148
148
|
prerelease: false
|
149
149
|
version_requirements: !ruby/object:Gem::Requirement
|
150
150
|
requirements:
|
151
151
|
- - "~>"
|
152
152
|
- !ruby/object:Gem::Version
|
153
|
-
version: 3.
|
153
|
+
version: 3.10.1
|
154
154
|
- !ruby/object:Gem::Dependency
|
155
155
|
name: highline
|
156
156
|
requirement: !ruby/object:Gem::Requirement
|
@@ -204,7 +204,6 @@ files:
|
|
204
204
|
- features/project_version.feature
|
205
205
|
- features/support/env.rb
|
206
206
|
- features/utils.feature
|
207
|
-
- lib/capistrano/copy.rb
|
208
207
|
- lib/capistrano/dkdeploy/core.rb
|
209
208
|
- lib/dkdeploy.rb
|
210
209
|
- lib/dkdeploy/constants.rb
|
@@ -266,7 +265,7 @@ homepage: https://github.com/dkdeploy/dkdeploy-core
|
|
266
265
|
licenses:
|
267
266
|
- MIT
|
268
267
|
metadata: {}
|
269
|
-
post_install_message:
|
268
|
+
post_install_message:
|
270
269
|
rdoc_options: []
|
271
270
|
require_paths:
|
272
271
|
- lib
|
@@ -281,8 +280,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
280
|
- !ruby/object:Gem::Version
|
282
281
|
version: '0'
|
283
282
|
requirements: []
|
284
|
-
|
285
|
-
|
283
|
+
rubyforge_project:
|
284
|
+
rubygems_version: 2.7.5
|
285
|
+
signing_key:
|
286
286
|
specification_version: 4
|
287
287
|
summary: dkd basic deployment tasks and strategies
|
288
288
|
test_files:
|
data/lib/capistrano/copy.rb
DELETED