dkdeploy-core 8.0.2 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +9 -0
- data/.travis.yml +13 -0
- data/CHANGELOG.md +38 -0
- data/CONTRIBUTORS.md +2 -0
- data/LICENSE +1 -1
- data/README.md +8 -5
- data/Vagrantfile +3 -10
- data/assets/dkdeploy-logo.png +0 -0
- data/config/vm/cookbooks/dkdeploy-core/recipes/default.rb +13 -1
- data/config/vm/cookbooks/dkdeploy-core/templates/my_extra_settings.erb +6 -0
- data/dkdeploy-core.gemspec +11 -12
- data/features/assets.feature +24 -26
- data/features/db.feature +4 -0
- data/features/mysql.feature +27 -0
- data/features/support/env.rb +1 -1
- data/lib/capistrano/dkdeploy/core.rb +11 -22
- data/lib/dkdeploy/constants.rb +5 -73
- data/lib/dkdeploy/core/version.rb +2 -2
- data/lib/dkdeploy/dsl.rb +1 -1
- data/lib/dkdeploy/helpers/assets.rb +0 -1
- data/lib/dkdeploy/helpers/db.rb +1 -1
- data/lib/dkdeploy/helpers/mysql.rb +17 -0
- data/lib/dkdeploy/i18n.rb +6 -0
- data/lib/dkdeploy/interaction_handler/mysql.rb +38 -0
- data/lib/dkdeploy/interaction_handler/password.rb +3 -2
- data/lib/dkdeploy/scm/copy.rake +76 -0
- data/lib/dkdeploy/scm/copy.rb +85 -0
- data/lib/dkdeploy/tasks/apache.rake +0 -1
- data/lib/dkdeploy/tasks/assets.rake +0 -1
- data/lib/dkdeploy/tasks/bower.rake +0 -1
- data/lib/dkdeploy/tasks/db.rake +20 -28
- data/lib/dkdeploy/tasks/deploy.rake +1 -11
- data/lib/dkdeploy/tasks/enhanced_symlinks.rake +3 -3
- data/lib/dkdeploy/tasks/file_access.rake +8 -9
- data/lib/dkdeploy/tasks/maintenance.rake +0 -1
- data/lib/dkdeploy/tasks/mysql.rake +50 -0
- data/lib/dkdeploy/tasks/project_version.rake +0 -1
- data/lib/dkdeploy/tasks/utils.rake +6 -2
- data/spec/fixtures/application/Gemfile +1 -1
- data/spec/fixtures/application/config/deploy/dev.rb +6 -3
- data/spec/fixtures/application/config/deploy.rb +42 -5
- data/spec/fixtures/application/config/preseed/default_content.sql.gz +0 -0
- data/spec/fixtures/application/config/preseed/download.tar.gz +0 -0
- data/spec/fixtures/capistrano/configuration/add_output_after_create_symlink.rb +1 -2
- data/spec/fixtures/capistrano/configuration/custom_compass_sources.rb +2 -2
- metadata +41 -55
- data/lib/dkdeploy/copy.rb +0 -121
- data/lib/dkdeploy/tasks/copy.rake +0 -26
- data/spec/fixtures/application/config/preseed/fileadmin.tar.gz +0 -0
- data/spec/fixtures/application/config/preseed/uploads.tar.gz +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0fa351619fa4722337d6fed4eaed15806f9ee10d
|
4
|
+
data.tar.gz: 49176a8bb577edf5251c4f5cc77bac4e7c11172d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32be81315488b81b06275168d880499745d74d88d5567e43c4a6dd21ce6e2a53c89fd4ef190e9a9739f454096b949fd38b9969b5b12c66a86a3dfbb2e40a85f0
|
7
|
+
data.tar.gz: 20786fdcf4fdeaa824a2c3fa18ab91a78030b5ba1c038676e0747010b736076f9f80c6e5dd8175aae4d49cc40892a20a06f3ad35895839cad03df31de295323c
|
data/.rubocop.yml
CHANGED
@@ -4,6 +4,11 @@ AllCops:
|
|
4
4
|
- 'spec/fixtures/application/htdocs/stylesheets/**/config.rb'
|
5
5
|
- 'config/**/*'
|
6
6
|
- 'Vagrantfile'
|
7
|
+
- 'vendor/**/*'
|
8
|
+
TargetRubyVersion: 2.2
|
9
|
+
ExtraDetails: true
|
10
|
+
DisplayStyleGuide: true
|
11
|
+
DisplayCopNames: true
|
7
12
|
GlobalVars:
|
8
13
|
AllowedVariables: []
|
9
14
|
MethodLength:
|
@@ -16,3 +21,7 @@ BracesAroundHashParameters:
|
|
16
21
|
Enabled: false
|
17
22
|
CyclomaticComplexity:
|
18
23
|
Max: 10
|
24
|
+
Metrics/BlockLength:
|
25
|
+
Enabled: false
|
26
|
+
Style/FormatStringToken:
|
27
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
# Changelog
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
|
5
|
+
## [9.0.0]
|
6
|
+
### Summary
|
7
|
+
|
8
|
+
- tasks around MySQL slow log
|
9
|
+
- add `utils:create_local_temp_directory` task
|
10
|
+
- support for dkdeploy-test_environment v2.0.0
|
11
|
+
- Vagrant 2.0.x support
|
12
|
+
- rubocop upgrade to 0.50
|
13
|
+
- update capistrano to v3.9.0
|
14
|
+
- remove jenkins release suffix
|
15
|
+
- configuration option `additional_ignore_tables` changes from `string` to `array`
|
16
|
+
- set group permissions for `/var/www` in Chef cookbook (Vagrant)
|
17
|
+
- set proper gem homepage
|
18
|
+
- add travis support
|
19
|
+
- improved code syntax according to RuboCop
|
20
|
+
- install `mysql` instead of `mysql-connector-c`
|
21
|
+
- remove sshkit dsl includes
|
22
|
+
- remove TYPO3 specific configuration
|
23
|
+
- change some SCM roles from app to all
|
24
|
+
|
25
|
+
## [8.0.1] - 2017-05-15
|
26
|
+
### Summary
|
27
|
+
|
28
|
+
- hotfix for GH25: erroneous Capistrano scope
|
29
|
+
|
30
|
+
## [8.0.0] - 2016-06-20
|
31
|
+
### Summary
|
32
|
+
|
33
|
+
- first public release
|
34
|
+
|
35
|
+
[Unreleased]: https://github.com/dkdeploy/dkdeploy-core/compare/master...develop
|
36
|
+
[9.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v9.0.0
|
37
|
+
[8.0.1]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.1
|
38
|
+
[8.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.0
|
data/CONTRIBUTORS.md
CHANGED
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c) 2014-
|
1
|
+
Copyright (c) 2014-2017 dkd Internet Service GmbH, Frankfurt am Main (Germany), https://dkd.de/
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
4
4
|
|
data/README.md
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
|
1
|
+
![dkdeploy](assets/dkdeploy-logo.png)
|
2
2
|
|
3
|
-
|
3
|
+
# dkdeploy::core
|
4
|
+
|
5
|
+
[![Build Status](https://travis-ci.org/dkdeploy/dkdeploy-core.svg?branch=develop)](https://travis-ci.org/dkdeploy/dkdeploy-core)
|
6
|
+
[![Gem Version](https://badge.fury.io/rb/dkdeploy-core.svg)](https://badge.fury.io/rb/dkdeploy-core) [![Inline docs](http://inch-ci.org/github/dkdeploy/dkdeploy-core.svg?branch=develop)](http://inch-ci.org/github/dkdeploy/dkdeploy-core)
|
4
7
|
|
5
8
|
## Description
|
6
9
|
|
@@ -10,7 +13,7 @@ This Rubygem `dkdeploy-core` represents the extension of [Capistrano](http://cap
|
|
10
13
|
|
11
14
|
Add this line to your application's `Gemfile`
|
12
15
|
|
13
|
-
gem 'dkdeploy-core', '~>
|
16
|
+
gem 'dkdeploy-core', '~> 9.0'
|
14
17
|
|
15
18
|
and then execute
|
16
19
|
|
@@ -61,7 +64,7 @@ The complete list of the dkdeploy constants you find in `/lib/capistrano/dkdeplo
|
|
61
64
|
|
62
65
|
### Prerequisite
|
63
66
|
|
64
|
-
rvm (v1.
|
67
|
+
rvm (v1.29.x) with installed Ruby 2.2.
|
65
68
|
|
66
69
|
Add the virtual box alias to your `hosts` file
|
67
70
|
|
@@ -76,7 +79,7 @@ Add the virtual box alias to your `hosts` file
|
|
76
79
|
## Contributing
|
77
80
|
|
78
81
|
1. Install [git flow](https://github.com/nvie/gitflow)
|
79
|
-
2. Install [Homebrew](http://brew.sh/) and run `brew install mysql
|
82
|
+
2. Install [Homebrew](http://brew.sh/) and run `brew install mysql`
|
80
83
|
3. Install [NodeJS](https://nodejs.org) (supported: v0.12.7) via `brew install nodejs`
|
81
84
|
4. Install [Bower](http://bower.io) (supported: v1.7.9) via `npm install -g bower@1.7.9`
|
82
85
|
5. If project is not checked out already do git clone `git@github.com:dkdeploy/dkdeploy-core.git`
|
data/Vagrantfile
CHANGED
@@ -5,14 +5,7 @@ unless Vagrant.has_plugin?('vagrant-berkshelf')
|
|
5
5
|
abort
|
6
6
|
end
|
7
7
|
|
8
|
-
|
9
|
-
puts "Please install vagrant plugin vagrant-omnibus first\n"
|
10
|
-
puts " vagrant plugin install vagrant-omnibus\n\n"
|
11
|
-
puts "Exit vagrant\n\n"
|
12
|
-
abort
|
13
|
-
end
|
14
|
-
|
15
|
-
Vagrant.require_version '~> 1.8.1'
|
8
|
+
Vagrant.require_version '~> 2.0.0'
|
16
9
|
chef_version = '12.9.41'
|
17
10
|
|
18
11
|
Vagrant.configure(2) do |config|
|
@@ -23,15 +16,15 @@ Vagrant.configure(2) do |config|
|
|
23
16
|
config.vm.box = 'ubuntu/trusty64'
|
24
17
|
config.vm.box_check_update = false
|
25
18
|
config.berkshelf.enabled = true
|
26
|
-
config.omnibus.chef_version = chef_version
|
27
19
|
|
28
20
|
config.vm.define('dkdeploy-core', primary: true) do |master_config|
|
29
21
|
master_config.vm.network 'private_network', ip: ip_address
|
30
22
|
|
31
23
|
# Chef settings
|
32
24
|
master_config.vm.provision :chef_solo do |chef|
|
25
|
+
chef.install = true
|
26
|
+
chef.channel = 'stable'
|
33
27
|
chef.version = chef_version
|
34
|
-
chef.install = false # omnibus does it already
|
35
28
|
chef.log_level = :info
|
36
29
|
chef.add_recipe 'dkdeploy-core'
|
37
30
|
end
|
Binary file
|
@@ -22,6 +22,18 @@ mysql_service 'default' do
|
|
22
22
|
# Need for remote connection
|
23
23
|
bind_address '0.0.0.0'
|
24
24
|
action [:create, :start]
|
25
|
+
run_group 'vagrant'
|
26
|
+
run_user 'vagrant'
|
27
|
+
end
|
28
|
+
|
29
|
+
mysql_config 'default' do
|
30
|
+
instance 'default' # necessary in some cases, causes hanging on provisioning https://github.com/chef-cookbooks/mysql/issues/387
|
31
|
+
# use different user to allow capistrano access to log file
|
32
|
+
owner 'vagrant'
|
33
|
+
group 'vagrant'
|
34
|
+
source 'my_extra_settings.erb'
|
35
|
+
notifies :restart, 'mysql_service[default]'
|
36
|
+
action :create
|
25
37
|
end
|
26
38
|
|
27
39
|
mysql2_chef_gem 'default' do
|
@@ -50,7 +62,7 @@ end
|
|
50
62
|
|
51
63
|
directory '/var/www' do
|
52
64
|
owner 'vagrant'
|
53
|
-
|
65
|
+
group 'vagrant'
|
54
66
|
mode '0770'
|
55
67
|
action :create
|
56
68
|
end
|
data/dkdeploy-core.gemspec
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# coding: utf-8
|
2
1
|
lib = File.expand_path('../lib', __FILE__)
|
3
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
3
|
require 'dkdeploy/core/version'
|
@@ -7,28 +6,28 @@ Gem::Specification.new do |spec|
|
|
7
6
|
spec.name = 'dkdeploy-core'
|
8
7
|
spec.version = Dkdeploy::Core::Version
|
9
8
|
spec.license = 'MIT'
|
10
|
-
spec.authors = ['
|
11
|
-
spec.email = %w
|
9
|
+
spec.authors = ['Timo Webler', 'Nicolai Reuschling']
|
10
|
+
spec.email = %w[timo.webler@dkd.de nicolai.reuschling@dkd.de]
|
12
11
|
spec.description = 'dkd basic deployment tasks and strategies'
|
13
12
|
spec.summary = 'dkd basic deployment tasks and strategies'
|
14
|
-
spec.homepage = 'https://
|
13
|
+
spec.homepage = 'https://github.com/dkdeploy/dkdeploy-core'
|
14
|
+
spec.required_ruby_version = '~> 2.2'
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
|
21
|
-
spec.add_development_dependency 'bundler'
|
22
|
-
spec.add_development_dependency 'rake'
|
23
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.5'
|
24
24
|
spec.add_development_dependency 'cucumber', '~> 2.4'
|
25
|
-
spec.add_development_dependency 'rubocop', '~> 0.
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.50.0'
|
26
26
|
spec.add_development_dependency 'aruba', '~> 0.14.1'
|
27
27
|
spec.add_development_dependency 'mysql2', '~> 0.3'
|
28
|
-
spec.add_development_dependency 'pry', '~> 0.10
|
29
|
-
spec.add_development_dependency 'dkdeploy-test_environment', '~>
|
28
|
+
spec.add_development_dependency 'pry', '~> 0.10'
|
29
|
+
spec.add_development_dependency 'dkdeploy-test_environment', '~> 2.0'
|
30
30
|
|
31
|
-
spec.add_dependency 'capistrano', '~> 3.
|
32
|
-
spec.add_dependency 'sshkit', '= 1.10.0'
|
31
|
+
spec.add_dependency 'capistrano', '~> 3.9.0'
|
33
32
|
spec.add_dependency 'highline', '~> 1.7.1'
|
34
33
|
end
|
data/features/assets.feature
CHANGED
@@ -41,60 +41,58 @@ Feature: Test tasks for namespace 'assets'
|
|
41
41
|
Then the exit status should be 0
|
42
42
|
And a remote file named "shared_path/.htpasswd" should exist
|
43
43
|
|
44
|
-
Scenario: Check if cleanup is really cleaning
|
44
|
+
Scenario: Check if cleanup is really cleaning downloads
|
45
45
|
Given the remote server is cleared
|
46
46
|
And the project is deployed
|
47
47
|
When I successfully run `cap dev assets:cleanup`
|
48
|
-
Given a remote empty file named "assets_path/
|
49
|
-
Then a remote file named "assets_path/
|
48
|
+
Given a remote empty file named "assets_path/download/example.png"
|
49
|
+
Then a remote file named "assets_path/download/example.png" should exist
|
50
50
|
When I successfully run `cap dev assets:cleanup`
|
51
|
-
Then a remote file named "assets_path/
|
51
|
+
Then a remote file named "assets_path/download/example.png" should not exist
|
52
52
|
|
53
53
|
Scenario: Check if download is getting archives from the remote server
|
54
54
|
Given the remote server is cleared
|
55
55
|
And the project is deployed
|
56
56
|
When I successfully run `cap dev assets:cleanup`
|
57
|
-
|
58
|
-
And a remote empty file named "assets_path/
|
59
|
-
And
|
60
|
-
|
61
|
-
Then a file named "temp/assets/uploads.tar.gz" should exist
|
62
|
-
And a file named "temp/assets/fileadmin.tar.gz" should exist
|
57
|
+
And a remote empty file named "assets_path/download/example.png"
|
58
|
+
And a remote empty file named "assets_path/download/folder/example3.png"
|
59
|
+
And I run `cap dev assets:download`
|
60
|
+
Then a file named "temp/assets/download.tar.gz" should exist
|
63
61
|
|
64
62
|
Scenario: Check if update is filling the remote server from the local archives
|
65
63
|
Given the remote server is cleared
|
66
64
|
And the project is deployed
|
67
65
|
When I successfully run `cap dev assets:cleanup`
|
68
|
-
|
69
|
-
And a remote empty file named "assets_path/
|
70
|
-
And a remote empty file named "assets_path/
|
66
|
+
Then a remote empty file named "assets_path/download/file.html"
|
67
|
+
And a remote empty file named "assets_path/download/subdirectory/file2.html"
|
68
|
+
And a remote empty file named "assets_path/download/file3.html"
|
71
69
|
When I successfully run `cap dev assets:download`
|
72
70
|
And I successfully run `cap dev assets:cleanup`
|
73
|
-
Then a remote file named "assets_path/
|
74
|
-
And a remote file named "assets_path/
|
75
|
-
And a remote file named "assets_path/
|
71
|
+
Then a remote file named "assets_path/download/file.html" should not exist
|
72
|
+
And a remote file named "assets_path/download/subdirectory/file2.html" should not exist
|
73
|
+
And a remote file named "assets_path/download/file3.html" should not exist
|
76
74
|
When I successfully run `cap dev assets:update`
|
77
|
-
And a remote file named "assets_path/
|
78
|
-
And a remote file named "assets_path/
|
79
|
-
And a remote file named "assets_path/
|
75
|
+
And a remote file named "assets_path/download/file.html" should exist
|
76
|
+
And a remote file named "assets_path/download/subdirectory/file2.html" should exist
|
77
|
+
And a remote file named "assets_path/download/file3.html" should exist
|
80
78
|
|
81
79
|
Scenario: Check if add_default_content is filling the remote server from the local preseeds
|
82
80
|
Given the remote server is cleared
|
83
81
|
And the project is deployed
|
84
82
|
When I successfully run `cap dev assets:cleanup`
|
85
83
|
And I successfully run `cap dev assets:add_default_content`
|
86
|
-
Then a remote file named "assets_path/
|
87
|
-
And a remote file named "assets_path/
|
88
|
-
And a remote file named "assets_path/
|
84
|
+
Then a remote file named "assets_path/download/file1.html" should exist
|
85
|
+
And a remote file named "assets_path/download/subdirectory/file2.html" should exist
|
86
|
+
And a remote file named "assets_path/download/test.png" should exist
|
89
87
|
|
90
88
|
Scenario: Check if the exclude file is functioning
|
91
89
|
Given the remote server is cleared
|
92
90
|
And the project is deployed
|
93
91
|
When I successfully run `cap dev assets:cleanup`
|
94
|
-
Given a remote empty file named "assets_path/
|
95
|
-
Then a remote file named "assets_path/
|
92
|
+
Given a remote empty file named "assets_path/download/should_be_excluded.txt"
|
93
|
+
Then a remote file named "assets_path/download/should_be_excluded.txt" should exist
|
96
94
|
When I successfully run `cap dev assets:download`
|
97
95
|
And I successfully run `cap dev assets:cleanup`
|
98
|
-
Then a remote file named "assets_path/
|
96
|
+
Then a remote file named "assets_path/download/should_be_excluded.txt" should not exist
|
99
97
|
When I successfully run `cap dev assets:update`
|
100
|
-
Then a remote file named "assets_path/
|
98
|
+
Then a remote file named "assets_path/download/should_be_excluded.txt" should not exist
|
data/features/db.feature
CHANGED
@@ -91,3 +91,7 @@ Feature: Test tasks for namespace 'db'
|
|
91
91
|
And I successfully run `cap dev db:add_default_content`
|
92
92
|
And I wait 5 second to let the database commit the transaction
|
93
93
|
Then the database should have a value `first preseed value` in table `preseed_table` for column `value`
|
94
|
+
|
95
|
+
Scenario: Check error answer of a broken SQL syntax
|
96
|
+
When I run `cap dev "db:sql_error"`
|
97
|
+
Then the output should match /ERROR 1064/
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: Test tasks for namespace 'mysql'
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given a test app with the default configuration
|
5
|
+
And the remote server is cleared
|
6
|
+
And I want to use the database `dkdeploy_core`
|
7
|
+
|
8
|
+
Scenario: Downloading the MYSQL slow log
|
9
|
+
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
|
10
|
+
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
|
11
|
+
And I successfully run `cap dev db:download_content`
|
12
|
+
And I successfully run `cap dev mysql:download_slow_log`
|
13
|
+
Then a file named "temp/slow-queries.dev.dkdeploy-core.dev.log" should exist
|
14
|
+
|
15
|
+
Scenario: Downloading the MYSQL slow log analyze file
|
16
|
+
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
|
17
|
+
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
|
18
|
+
And I successfully run `cap dev db:download_content`
|
19
|
+
And I successfully run `cap dev mysql:analyze_download_slow_log`
|
20
|
+
Then a file named "temp/mysql_slow_log_analyze.dev.dkdeploy-core.dev.log" should exist
|
21
|
+
|
22
|
+
Scenario: Clearing the MySQL slow log file
|
23
|
+
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
|
24
|
+
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
|
25
|
+
And I successfully run `cap dev db:download_content`
|
26
|
+
And I successfully run `cap dev mysql:clear_slow_log`
|
27
|
+
Then the output should match /has been cleared/
|
data/features/support/env.rb
CHANGED
@@ -18,5 +18,5 @@ TEST_APPLICATION.mysql_connection_settings = { host: 'dkdeploy-core.dev', userna
|
|
18
18
|
# The official way via Bundler.with_clean_env did not work properly here
|
19
19
|
Aruba.configure do |config|
|
20
20
|
config.command_runtime_environment = { 'BUNDLE_GEMFILE' => File.join(TEST_APPLICATION.test_app_path, 'Gemfile') }
|
21
|
-
config.exit_timeout =
|
21
|
+
config.exit_timeout = 30
|
22
22
|
end
|
@@ -2,6 +2,10 @@ include Capistrano::DSL
|
|
2
2
|
|
3
3
|
require 'dkdeploy/rollback_manager'
|
4
4
|
|
5
|
+
# Install copy plugin
|
6
|
+
require 'dkdeploy/scm/copy'
|
7
|
+
install_plugin Dkdeploy::SCM::Copy
|
8
|
+
|
5
9
|
# Load dkdeploy tasks
|
6
10
|
load File.expand_path('../../../dkdeploy/tasks/deploy.rake', __FILE__)
|
7
11
|
load File.expand_path('../../../dkdeploy/tasks/fail.rake', __FILE__)
|
@@ -15,6 +19,7 @@ load File.expand_path('../../../dkdeploy/tasks/db.rake', __FILE__)
|
|
15
19
|
load File.expand_path('../../../dkdeploy/tasks/enhanced_symlinks.rake', __FILE__)
|
16
20
|
load File.expand_path('../../../dkdeploy/tasks/current_folder.rake', __FILE__)
|
17
21
|
load File.expand_path('../../../dkdeploy/tasks/bower.rake', __FILE__)
|
22
|
+
load File.expand_path('../../../dkdeploy/tasks/mysql.rake', __FILE__)
|
18
23
|
|
19
24
|
# Hook into symlink related tasks
|
20
25
|
after 'deploy:check:linked_dirs', 'deploy:enhanced_symlinks:check:linked_dirs'
|
@@ -25,27 +30,8 @@ after 'deploy:symlink:linked_files', 'deploy:enhanced_symlinks:symlink:linked_fi
|
|
25
30
|
|
26
31
|
namespace :load do
|
27
32
|
task :defaults do
|
28
|
-
# Set scm to new scm "copy"
|
29
|
-
set :scm, :copy
|
30
|
-
|
31
|
-
# Set default values for copy scm
|
32
|
-
set :copy_source, 'htdocs'
|
33
|
-
set :copy_exclude, Array[
|
34
|
-
'vendor/bundle/**',
|
35
|
-
'Gemfile*',
|
36
|
-
'**/.git',
|
37
|
-
'**/.svn',
|
38
|
-
'**/.DS_Store',
|
39
|
-
'.settings',
|
40
|
-
'.project',
|
41
|
-
'.buildpath',
|
42
|
-
'Capfile',
|
43
|
-
'Thumbs.db',
|
44
|
-
'composer.lock'
|
45
|
-
]
|
46
|
-
|
47
33
|
# Set default web root paths
|
48
|
-
set
|
34
|
+
set(:local_web_root_path, -> { fetch(:copy_source) })
|
49
35
|
set :remote_web_root_path, '.'
|
50
36
|
|
51
37
|
# Set default version file path
|
@@ -71,8 +57,8 @@ namespace :load do
|
|
71
57
|
set :keep_rollback_archives, 5
|
72
58
|
|
73
59
|
# List of bower.json files
|
74
|
-
set
|
75
|
-
set
|
60
|
+
set(:bower_path, -> { fetch(:copy_source) })
|
61
|
+
set(:bower_paths, -> { Array(fetch(:copy_source)) })
|
76
62
|
|
77
63
|
# List of filters for file_access:set_selected_custom_access
|
78
64
|
set :selected_custom_file_access, []
|
@@ -84,5 +70,8 @@ namespace :load do
|
|
84
70
|
|
85
71
|
# Airbrush configuration
|
86
72
|
set :format_options, command_output: true, log_file: nil, truncate: false
|
73
|
+
|
74
|
+
# MySQL slow_log
|
75
|
+
set :mysql_slow_log, ''
|
87
76
|
end
|
88
77
|
end
|
data/lib/dkdeploy/constants.rb
CHANGED
@@ -66,32 +66,16 @@ module Dkdeploy
|
|
66
66
|
#
|
67
67
|
# @return [String]
|
68
68
|
def default_ignore_tables
|
69
|
-
%w
|
70
|
-
cache_extensions cache_hash cache_imagesizes cache_md5params
|
71
|
-
cache_pages cache_pagesection cache_sys_dmail_stat cache_treelist cache_typo3temp_log
|
72
|
-
cachingframework_cache_hash cachingframework_cache_hash_tags cachingframework_cache_pages
|
73
|
-
cachingframework_cache_pages_tags cachingframework_cache_pagesection
|
74
|
-
cachingframework_cache_pagesection_tags sys_workspace_cache sys_workspace_cache_tags
|
75
|
-
tt_news_cache tt_news_cache_tags tx_extbase_cache_object tx_extbase_cache_object_tags
|
76
|
-
tx_extbase_cache_reflection tx_extbase_cache_reflection_tags tx_realurl_chashcache
|
77
|
-
tx_realurl_pathcache tx_realurl_urldecodecache tx_realurl_urlencodecache be_users be_sessions
|
78
|
-
sys_domain fe_users fe_sessions fe_session_data
|
79
|
-
cf_cache_hash cf_cache_hash_tags cf_cache_pages cf_cache_pages_tags cf_cache_pagesection
|
80
|
-
cf_cache_pagesection_tags cf_cache_rootline cf_cache_rootline_tags cf_extbase_datamapfactory_datamap
|
81
|
-
cf_extbase_datamapfactory_datamap_tags cf_extbase_object cf_extbase_object_tags
|
82
|
-
cf_extbase_reflection cf_extbase_reflection_tags cf_extbase_typo3dbbackend_queries
|
83
|
-
cf_extbase_typo3dbbackend_queries_tags cf_extbase_typo3dbbackend_tablecolumns
|
84
|
-
cf_extbase_typo3dbbackend_tablecolumns_tags
|
85
|
-
)
|
69
|
+
%w[]
|
86
70
|
end
|
87
71
|
|
88
72
|
# List of table names to be ignored when dumping from database defined via Capistrano variable or environment variable
|
89
73
|
#
|
90
|
-
# @return [
|
74
|
+
# @return [Array]
|
91
75
|
def additional_ignore_tables
|
92
|
-
|
93
|
-
|
94
|
-
|
76
|
+
env_array_list = ENV.fetch('ADDITIONAL_IGNORE_TABLES', '').split ' '
|
77
|
+
cap_array_list = fetch(:additional_ignore_tables, [])
|
78
|
+
env_array_list | cap_array_list
|
95
79
|
end
|
96
80
|
|
97
81
|
# List of table names to be ignored when dumping from database
|
@@ -100,57 +84,5 @@ module Dkdeploy
|
|
100
84
|
def ignore_tables
|
101
85
|
default_ignore_tables | additional_ignore_tables
|
102
86
|
end
|
103
|
-
|
104
|
-
#####################################################
|
105
|
-
# Local temporary directory constants
|
106
|
-
#####################################################
|
107
|
-
|
108
|
-
# Archive filename as singleton
|
109
|
-
# Note: if the archive filename doesn't already exist it will be generated
|
110
|
-
#
|
111
|
-
# @return [String]
|
112
|
-
def archive_filename
|
113
|
-
@archive_filename ||= Dir::Tmpname.make_tmpname [application + '_', '.tar.gz'], nil
|
114
|
-
end
|
115
|
-
|
116
|
-
# Local temporary directory path as singleton
|
117
|
-
# Note: if the directory doesn't already exist it will be created
|
118
|
-
#
|
119
|
-
# @return [String]
|
120
|
-
def local_tmp_dir
|
121
|
-
@local_tmp_dir ||= Dir.mktmpdir
|
122
|
-
end
|
123
|
-
|
124
|
-
# Archive path in a local temporary directory
|
125
|
-
#
|
126
|
-
# @return [String]
|
127
|
-
def local_exclude_path
|
128
|
-
File.join local_tmp_dir, 'exclude.txt'
|
129
|
-
end
|
130
|
-
|
131
|
-
# Archive path in a local temporary directory
|
132
|
-
#
|
133
|
-
# @return [String]
|
134
|
-
def local_archive_path
|
135
|
-
File.join local_tmp_dir, archive_filename
|
136
|
-
end
|
137
|
-
|
138
|
-
#####################################################
|
139
|
-
# remote paths constants
|
140
|
-
#####################################################
|
141
|
-
|
142
|
-
# Remote temporary directory path
|
143
|
-
#
|
144
|
-
# @return [String]
|
145
|
-
def remote_tmp_dir
|
146
|
-
File.join fetch(:tmp_dir), application
|
147
|
-
end
|
148
|
-
|
149
|
-
# Archive path in a remote temporary directory
|
150
|
-
#
|
151
|
-
# @return [String]
|
152
|
-
def remote_archive_path
|
153
|
-
File.join remote_tmp_dir, archive_filename
|
154
|
-
end
|
155
87
|
end
|
156
88
|
end
|
data/lib/dkdeploy/dsl.rb
CHANGED
data/lib/dkdeploy/helpers/db.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
include Capistrano::DSL
|
2
|
+
|
3
|
+
module Dkdeploy
|
4
|
+
module Helpers
|
5
|
+
# Helpers for MySQL slow_log tasks
|
6
|
+
module MySQL
|
7
|
+
# checks for existence of mysql_sloq_log on server and prints error message if not present
|
8
|
+
# @param file_path [String]
|
9
|
+
# @return [Boolean]
|
10
|
+
def slow_log_exists?(file_path)
|
11
|
+
return true if !file_path.empty? && test("[ -f #{file_path} ]")
|
12
|
+
error I18n.t('file.not_exists_or_not_accessible_on_host', file: file_path, host: server, scope: :dkdeploy)
|
13
|
+
false
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/dkdeploy/i18n.rb
CHANGED
@@ -3,9 +3,11 @@ require 'i18n'
|
|
3
3
|
en = {
|
4
4
|
file: {
|
5
5
|
not_exists: 'File %{file} does not exist.',
|
6
|
+
not_exists_or_not_accessible_on_host: 'File %{file} does not exist on host %{host} or is not accessible.',
|
6
7
|
not_exists_on_host: 'File %{file} does not exit on host %{host}.',
|
7
8
|
upload: 'Uploading %{file} to %{target}.',
|
8
9
|
download: 'Downloading %{file} to %{target}.',
|
10
|
+
download_from_host: 'Downloading %{file} to %{target} from %{host}.',
|
9
11
|
copy: 'Copying %{file} to %{target}.',
|
10
12
|
remove: 'Removing %{path}.'
|
11
13
|
},
|
@@ -107,6 +109,10 @@ en = {
|
|
107
109
|
disabled: 'The %{mode} maintenance mode has successfully been disabled.',
|
108
110
|
can_not_disable_by_reason_of_permanent: "Maintenance permanent mode has been enabled. Please call the task 'maintenance:disable_permanent'."
|
109
111
|
},
|
112
|
+
mysql: {
|
113
|
+
clear_slow_log: 'MySQL slow log file %{file} on host %{host} has been cleared',
|
114
|
+
analyze_slow_log: 'Generating slow log analyze file for host %{host)'
|
115
|
+
},
|
110
116
|
project_version: {
|
111
117
|
update: {
|
112
118
|
update: 'Updating the Version file.'
|