dkdeploy-core 8.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +20 -0
- data/.rubocop.yml +18 -0
- data/Berksfile +3 -0
- data/Berksfile.lock +46 -0
- data/CONTRIBUTORS.md +16 -0
- data/Gemfile +4 -0
- data/LICENSE +7 -0
- data/README.md +88 -0
- data/Rakefile +5 -0
- data/Vagrantfile +60 -0
- data/config/vm/cookbooks/dkdeploy-core/metadata.rb +10 -0
- data/config/vm/cookbooks/dkdeploy-core/recipes/default.rb +56 -0
- data/dkdeploy-core.gemspec +34 -0
- data/features/apache.feature +35 -0
- data/features/assets.feature +100 -0
- data/features/bower.feature +52 -0
- data/features/current_folder.feature +17 -0
- data/features/db.feature +93 -0
- data/features/deploy.feature +48 -0
- data/features/enhanced_symlinks.feature +17 -0
- data/features/error_handlers.feature +59 -0
- data/features/file_access.feature +120 -0
- data/features/maintenance.feature +25 -0
- data/features/project_version.feature +42 -0
- data/features/support/env.rb +22 -0
- data/features/utils.feature +81 -0
- data/lib/capistrano/copy.rb +2 -0
- data/lib/capistrano/dkdeploy/core.rb +88 -0
- data/lib/dkdeploy/constants.rb +156 -0
- data/lib/dkdeploy/copy.rb +121 -0
- data/lib/dkdeploy/core/version.rb +15 -0
- data/lib/dkdeploy/dsl.rb +23 -0
- data/lib/dkdeploy/helpers/assets.rb +50 -0
- data/lib/dkdeploy/helpers/common.rb +31 -0
- data/lib/dkdeploy/helpers/db.rb +49 -0
- data/lib/dkdeploy/helpers/file_system.rb +76 -0
- data/lib/dkdeploy/i18n.rb +143 -0
- data/lib/dkdeploy/interaction_handler/password.rb +27 -0
- data/lib/dkdeploy/rollback_manager.rb +18 -0
- data/lib/dkdeploy/tasks/apache.rake +29 -0
- data/lib/dkdeploy/tasks/assets.rake +96 -0
- data/lib/dkdeploy/tasks/bower.rake +54 -0
- data/lib/dkdeploy/tasks/copy.rake +26 -0
- data/lib/dkdeploy/tasks/current_folder.rake +16 -0
- data/lib/dkdeploy/tasks/db.rake +412 -0
- data/lib/dkdeploy/tasks/deploy.rake +77 -0
- data/lib/dkdeploy/tasks/enhanced_symlinks.rake +74 -0
- data/lib/dkdeploy/tasks/fail.rake +8 -0
- data/lib/dkdeploy/tasks/file_access.rake +89 -0
- data/lib/dkdeploy/tasks/maintenance.rake +73 -0
- data/lib/dkdeploy/tasks/project_version.rake +32 -0
- data/lib/dkdeploy/tasks/utils.rake +141 -0
- data/lib/dkdeploy.rb +1 -0
- data/spec/fixtures/application/Capfile +11 -0
- data/spec/fixtures/application/Gemfile +11 -0
- data/spec/fixtures/application/Version +1 -0
- data/spec/fixtures/application/config/assets_exclude_file.txt +1 -0
- data/spec/fixtures/application/config/deploy/dev.rb +35 -0
- data/spec/fixtures/application/config/deploy.rb +18 -0
- data/spec/fixtures/application/config/etc/apache2/conf/.htaccess.erb +12 -0
- data/spec/fixtures/application/config/etc/apache2/conf/dev.htaccess.erb +3 -0
- data/spec/fixtures/application/config/preseed/default_content.sql.gz +0 -0
- data/spec/fixtures/application/config/preseed/default_structure.sql.gz +0 -0
- data/spec/fixtures/application/config/preseed/fileadmin.tar.gz +0 -0
- data/spec/fixtures/application/config/preseed/uploads.tar.gz +0 -0
- data/spec/fixtures/application/htdocs/.hidden/.gitkeep +0 -0
- data/spec/fixtures/application/htdocs/Gemfile +0 -0
- data/spec/fixtures/application/htdocs/bower.json +15 -0
- data/spec/fixtures/application/htdocs/catalog/.hidden/.gitkeep +0 -0
- data/spec/fixtures/application/htdocs/catalog/index.html +1 -0
- data/spec/fixtures/application/htdocs/index.html +1 -0
- data/spec/fixtures/application/htdocs/stylesheets/test1/config.rb +3 -0
- data/spec/fixtures/application/htdocs/stylesheets/test1/css/.gitkeep +0 -0
- data/spec/fixtures/application/htdocs/stylesheets/test1/src/source.scss +5 -0
- data/spec/fixtures/application/htdocs/stylesheets/test2/config.rb +3 -0
- data/spec/fixtures/application/htdocs/stylesheets/test2/css/.gitkeep +0 -0
- data/spec/fixtures/application/htdocs/stylesheets/test2/src/source.scss +5 -0
- data/spec/fixtures/application/temp/dkdeploy_core.sql.gz +0 -0
- data/spec/fixtures/capistrano/configuration/add_output_after_create_symlink.rb +7 -0
- data/spec/fixtures/capistrano/configuration/custom_compass_sources.rb +4 -0
- data/spec/fixtures/capistrano/configuration/custom_file_access.rb +13 -0
- data/spec/fixtures/capistrano/configuration/default_deployment_behaviour.rb +9 -0
- metadata +346 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1917de8366d09d735d45edfb17831902efecef8c
|
4
|
+
data.tar.gz: 82c78217ef34e6b25b9b17c6aba874bb3c0ca0f7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5406224374c692372a2633db3d31904774998f9535e21837c27d93cd40056eb26f7a25f61895e0b6221f7a8c651b8b7cd08833e2c2ca30ae713e7616684a5e3
|
7
|
+
data.tar.gz: f3a139321448651327315f2db45416d0e328d255cfd493564f604f70bd74c10a561ec081bb3f2d1b7f914e484884457b1815c9d4d3ffcd0581ae871172a9ba70
|
data/.gitignore
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- 'tmp/**/*'
|
4
|
+
- 'spec/fixtures/application/htdocs/stylesheets/**/config.rb'
|
5
|
+
- 'config/**/*'
|
6
|
+
- 'Vagrantfile'
|
7
|
+
GlobalVars:
|
8
|
+
AllowedVariables: []
|
9
|
+
MethodLength:
|
10
|
+
Max: 25
|
11
|
+
LineLength:
|
12
|
+
Max: 200
|
13
|
+
SpecialGlobalVars:
|
14
|
+
Enabled: false
|
15
|
+
BracesAroundHashParameters:
|
16
|
+
Enabled: false
|
17
|
+
CyclomaticComplexity:
|
18
|
+
Max: 10
|
data/Berksfile
ADDED
data/Berksfile.lock
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
DEPENDENCIES
|
2
|
+
dkdeploy-core
|
3
|
+
path: config/vm/cookbooks/dkdeploy-core
|
4
|
+
|
5
|
+
GRAPH
|
6
|
+
7-zip (1.0.2)
|
7
|
+
windows (>= 1.2.2)
|
8
|
+
apt (2.9.2)
|
9
|
+
build-essential (2.3.1)
|
10
|
+
7-zip (>= 0.0.0)
|
11
|
+
chef-sugar (3.3.0)
|
12
|
+
chef_handler (1.3.0)
|
13
|
+
database (4.0.9)
|
14
|
+
postgresql (>= 1.0.0)
|
15
|
+
dkdeploy-core (1.0.0)
|
16
|
+
apt (~> 2.9)
|
17
|
+
database (~> 4.0)
|
18
|
+
mysql (~> 6.0)
|
19
|
+
mysql2_chef_gem (~> 1.0)
|
20
|
+
mariadb (0.3.1)
|
21
|
+
apt (>= 0.0.0)
|
22
|
+
yum (>= 0.0.0)
|
23
|
+
yum-epel (>= 0.0.0)
|
24
|
+
mysql (6.1.2)
|
25
|
+
smf (>= 0.0.0)
|
26
|
+
yum-mysql-community (>= 0.0.0)
|
27
|
+
mysql2_chef_gem (1.0.2)
|
28
|
+
build-essential (>= 0.0.0)
|
29
|
+
mariadb (>= 0.0.0)
|
30
|
+
mysql (~> 6.0)
|
31
|
+
openssl (4.4.0)
|
32
|
+
chef-sugar (>= 3.1.1)
|
33
|
+
postgresql (4.0.0)
|
34
|
+
apt (>= 1.9.0)
|
35
|
+
build-essential (>= 0.0.0)
|
36
|
+
openssl (~> 4.0)
|
37
|
+
rbac (1.0.3)
|
38
|
+
smf (2.2.8)
|
39
|
+
rbac (>= 1.0.1)
|
40
|
+
windows (1.39.1)
|
41
|
+
chef_handler (>= 0.0.0)
|
42
|
+
yum (3.10.0)
|
43
|
+
yum-epel (0.6.5)
|
44
|
+
yum (~> 3.2)
|
45
|
+
yum-mysql-community (0.1.21)
|
46
|
+
yum (>= 3.2)
|
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# dkdeploy CONTRIBUTORS
|
2
|
+
|
3
|
+
The dkdeploy core maintainers would like to recognize following contributors (in alphabetic order):
|
4
|
+
|
5
|
+
- Sascha Egerer
|
6
|
+
- Christoph Gerold
|
7
|
+
- Johannes Goslar
|
8
|
+
- Kieran Hayes
|
9
|
+
- Wilfried Irßlinger
|
10
|
+
- Thomas Jahnke
|
11
|
+
- Gleb Levitin
|
12
|
+
- Luka Lüdicke
|
13
|
+
- Nicolai Reuschling
|
14
|
+
- Lars Tode
|
15
|
+
- Timo Webler
|
16
|
+
- Mike Zaschka
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
Copyright (c) 2014-2016 dkd Internet Service GmbH, Frankfurt am Main (Germany), https://dkd.de/
|
2
|
+
|
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
|
+
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
6
|
+
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
# Dkdeploy::Core
|
2
|
+
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/dkdeploy-core.svg)](https://badge.fury.io/rb/dkdeploy-core)
|
4
|
+
|
5
|
+
## Description
|
6
|
+
|
7
|
+
This Rubygem `dkdeploy-core` represents the extension of [Capistrano](http://capistranorb.com/) tasks directed to advanced deployment processes.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's `Gemfile`
|
12
|
+
|
13
|
+
gem 'dkdeploy-core', '~> 8.0'
|
14
|
+
|
15
|
+
and then execute
|
16
|
+
|
17
|
+
bundle install
|
18
|
+
|
19
|
+
or install it yourself as
|
20
|
+
|
21
|
+
gem install dkdeploy-core
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Run in your project root
|
26
|
+
|
27
|
+
cap install STAGES='dev,integration,testing,production'
|
28
|
+
|
29
|
+
This command will create the following Capistrano file structure with all the standard pre-configured constants.
|
30
|
+
Please be aware of the difference to the [native installation](http://capistranorb.com/documentation/getting-started/preparing-your-application/) of Capistrano.
|
31
|
+
Certainly you have to adjust `config/deploy.rb` and respective stages and customize them for your needs.
|
32
|
+
|
33
|
+
<pre>
|
34
|
+
├── Capfile
|
35
|
+
└── config
|
36
|
+
├── deploy
|
37
|
+
│ ├── dev.rb
|
38
|
+
│ ├── integration.rb
|
39
|
+
│ ├── testing.rb
|
40
|
+
│ └── production.rb
|
41
|
+
└── deploy.rb
|
42
|
+
</pre>
|
43
|
+
|
44
|
+
As next you have to append the following line to the `Capfile` in order to make use of dkdeploy extensions in addition to the standard Capistrano tasks:
|
45
|
+
|
46
|
+
require 'capistrano/dkdeploy/core'
|
47
|
+
|
48
|
+
To convince yourself, that Capistrano tasks list has been extended, please run
|
49
|
+
|
50
|
+
cap -vT
|
51
|
+
|
52
|
+
Please note, that dkdeploy uses the local copy strategy and overwrites the `:scm` constant. If you want to use it,
|
53
|
+
you should do nothing more. However if you want to change it, for example to `:git`, please add the following line to `deploy.rb`
|
54
|
+
|
55
|
+
set :scm, :git
|
56
|
+
|
57
|
+
For more information about available Capistrano constants please use the [Capistrano documentation](http://capistranorb.com/documentation/getting-started/preparing-your-application/).
|
58
|
+
The complete list of the dkdeploy constants you find in `/lib/capistrano/dkdeploy/core.rb`.
|
59
|
+
|
60
|
+
## Testing
|
61
|
+
|
62
|
+
### Prerequisite
|
63
|
+
|
64
|
+
rvm (v1.25.x) with installed Ruby 2.1.
|
65
|
+
|
66
|
+
Add the virtual box alias to your `hosts` file
|
67
|
+
|
68
|
+
192.168.156.180 dkdeploy-core.dev
|
69
|
+
|
70
|
+
### Running tests
|
71
|
+
|
72
|
+
1. Starting the local box (`vagrant up --provision`)
|
73
|
+
2. Checking coding styles (`rubocop`)
|
74
|
+
3. Running BDD cucumber tests (`cucumber`)
|
75
|
+
|
76
|
+
## Contributing
|
77
|
+
|
78
|
+
1. Install [git flow](https://github.com/nvie/gitflow)
|
79
|
+
2. Install [Homebrew](http://brew.sh/) and run `brew install mysql-connector-c`
|
80
|
+
3. Install [NodeJS](https://nodejs.org) (supported: v0.12.7) via `brew install nodejs`
|
81
|
+
4. Install [Bower](http://bower.io) (supported: v1.7.9) via `npm install -g bower@1.7.9`
|
82
|
+
5. If project is not checked out already do git clone `git@github.com:dkdeploy/dkdeploy-core.git`
|
83
|
+
6. Checkout origin develop branch (`git checkout --track -b develop origin/develop`)
|
84
|
+
7. Git flow initialze `git flow init -d`
|
85
|
+
8. Installing gems `bundle install`
|
86
|
+
9. Create new feature branch (`git flow feature start my-new-feature`)
|
87
|
+
10. Run tests (README.md Testing)
|
88
|
+
11. Commit your changes (`git commit -am 'Add some feature'`)
|
data/Rakefile
ADDED
data/Vagrantfile
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
unless Vagrant.has_plugin?('vagrant-berkshelf')
|
2
|
+
puts "Please install vagrant plugin vagrant-berkshelfs first\n"
|
3
|
+
puts " vagrant plugin install vagrant-berkshelf\n\n"
|
4
|
+
puts "Exit vagrant\n\n"
|
5
|
+
abort
|
6
|
+
end
|
7
|
+
|
8
|
+
unless Vagrant.has_plugin?('vagrant-omnibus')
|
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'
|
16
|
+
chef_version = '12.9.41'
|
17
|
+
|
18
|
+
Vagrant.configure(2) do |config|
|
19
|
+
domain = 'dkdeploy-core.dev'
|
20
|
+
ip_address = '192.168.156.180'
|
21
|
+
|
22
|
+
# Search boxes at https://atlas.hashicorp.com/search.
|
23
|
+
config.vm.box = 'ubuntu/trusty64'
|
24
|
+
config.vm.box_check_update = false
|
25
|
+
config.berkshelf.enabled = true
|
26
|
+
config.omnibus.chef_version = chef_version
|
27
|
+
|
28
|
+
config.vm.define('dkdeploy-core', primary: true) do |master_config|
|
29
|
+
master_config.vm.network 'private_network', ip: ip_address
|
30
|
+
|
31
|
+
# Chef settings
|
32
|
+
master_config.vm.provision :chef_solo do |chef|
|
33
|
+
chef.version = chef_version
|
34
|
+
chef.install = false # omnibus does it already
|
35
|
+
chef.log_level = :info
|
36
|
+
chef.add_recipe 'dkdeploy-core'
|
37
|
+
end
|
38
|
+
|
39
|
+
# Memory limit and name of Virtualbox
|
40
|
+
master_config.vm.provider 'virtualbox' do |virtualbox|
|
41
|
+
virtualbox.name = domain
|
42
|
+
virtualbox.gui = ENV['ENABLE_GUI_MODE'] && ENV['ENABLE_GUI_MODE'] =~ /^(true|yes|y|1)$/i
|
43
|
+
virtualbox.customize [
|
44
|
+
'modifyvm', :id,
|
45
|
+
'--natdnsproxy1', 'off',
|
46
|
+
'--natdnshostresolver1', 'on',
|
47
|
+
'--memory', '1024'
|
48
|
+
]
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
if Vagrant.has_plugin?('landrush')
|
53
|
+
config.landrush.enabled = true
|
54
|
+
config.landrush.guest_redirect_dns = false
|
55
|
+
config.landrush.tld = 'dev'
|
56
|
+
config.landrush.host domain, ip_address
|
57
|
+
else
|
58
|
+
config.vm.post_up_message = "Either install Vagrant plugin 'landrush' or add this entry to your host file: #{ip_address} #{domain}"
|
59
|
+
end
|
60
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
# update apt packages
|
2
|
+
include_recipe 'apt'
|
3
|
+
|
4
|
+
# Create unix user for tests
|
5
|
+
user 'test-user' do
|
6
|
+
action :create
|
7
|
+
end
|
8
|
+
|
9
|
+
group 'test-group' do
|
10
|
+
action :create
|
11
|
+
append true
|
12
|
+
members 'test-user'
|
13
|
+
end
|
14
|
+
|
15
|
+
# install apache2-utils. It is needed for the assets:add_htpasswd task
|
16
|
+
package 'apache2-utils' do
|
17
|
+
action :install
|
18
|
+
end
|
19
|
+
|
20
|
+
mysql_service 'default' do
|
21
|
+
port '3306'
|
22
|
+
# Need for remote connection
|
23
|
+
bind_address '0.0.0.0'
|
24
|
+
action [:create, :start]
|
25
|
+
end
|
26
|
+
|
27
|
+
mysql2_chef_gem 'default' do
|
28
|
+
action :install
|
29
|
+
end
|
30
|
+
|
31
|
+
mysql_connection_info = {
|
32
|
+
:host => '127.0.0.1',
|
33
|
+
:username => 'root',
|
34
|
+
:password => 'ilikerandompasswords'
|
35
|
+
}
|
36
|
+
|
37
|
+
mysql_database 'dkdeploy_core' do
|
38
|
+
connection mysql_connection_info
|
39
|
+
action :create
|
40
|
+
end
|
41
|
+
|
42
|
+
mysql_database_user 'root' do
|
43
|
+
connection mysql_connection_info
|
44
|
+
host '%'
|
45
|
+
password 'ilikerandompasswords'
|
46
|
+
action :create
|
47
|
+
privileges [:all]
|
48
|
+
action :grant
|
49
|
+
end
|
50
|
+
|
51
|
+
directory '/var/www' do
|
52
|
+
owner 'vagrant'
|
53
|
+
owner 'vagrant'
|
54
|
+
mode '0770'
|
55
|
+
action :create
|
56
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'dkdeploy/core/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'dkdeploy-core'
|
8
|
+
spec.version = Dkdeploy::Core::Version
|
9
|
+
spec.license = 'MIT'
|
10
|
+
spec.authors = ['Lars Tode', 'Timo Webler', 'Kieran Hayes', 'Nicolai Reuschling', 'Johannes Goslar', 'Luka Lüdicke']
|
11
|
+
spec.email = %w(lars.tode@dkd.de timo.webler@dkd.de kieran.hayes@dkd.de nicolai.reuschling@dkd.de johannes.goslar@dkd.de luka.luedicke@dkd.de)
|
12
|
+
spec.description = 'dkd basic deployment tasks and strategies'
|
13
|
+
spec.summary = 'dkd basic deployment tasks and strategies'
|
14
|
+
spec.homepage = 'https://redmine.dkd.de/projects/dkdeploy/wiki'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.12.5'
|
22
|
+
spec.add_development_dependency 'rake', '~> 11.2'
|
23
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
24
|
+
spec.add_development_dependency 'cucumber', '~> 2.4'
|
25
|
+
spec.add_development_dependency 'rubocop', '~> 0.40'
|
26
|
+
spec.add_development_dependency 'aruba', '~> 0.14.1'
|
27
|
+
spec.add_development_dependency 'mysql2', '~> 0.3'
|
28
|
+
spec.add_development_dependency 'pry', '~> 0.10.3'
|
29
|
+
spec.add_development_dependency 'dkdeploy-test_environment', '~> 1.0'
|
30
|
+
|
31
|
+
spec.add_dependency 'capistrano', '~> 3.5.0'
|
32
|
+
spec.add_dependency 'sshkit', '= 1.10.0'
|
33
|
+
spec.add_dependency 'highline', '~> 1.7.1'
|
34
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
Feature: Test tasks for namespace 'apache'
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given a test app with the default configuration
|
5
|
+
|
6
|
+
Scenario: copy only a local .htaccess file into web root (there is no other stage specific .htaccess file available)
|
7
|
+
When I remove the file "config/etc/apache2/conf/dev.htaccess.erb"
|
8
|
+
And I successfully run `cap dev apache:htaccess`
|
9
|
+
Then a file named "htdocs/.htaccess" should exist
|
10
|
+
And the file "htdocs/.htaccess" should contain exactly:
|
11
|
+
"""
|
12
|
+
<FilesMatch "index.php">
|
13
|
+
Allow from all
|
14
|
+
</FilesMatch>
|
15
|
+
|
16
|
+
"""
|
17
|
+
|
18
|
+
Scenario: copy a local .htaccess file into web root and merge it with dev.htacces
|
19
|
+
When I successfully run `cap dev apache:htaccess`
|
20
|
+
Then a file named "htdocs/.htaccess" should exist
|
21
|
+
And the file "htdocs/.htaccess" should contain exactly:
|
22
|
+
"""
|
23
|
+
<FilesMatch "index.php">
|
24
|
+
Allow from all
|
25
|
+
</FilesMatch>
|
26
|
+
<Files "favicon.ico">
|
27
|
+
Deny from all
|
28
|
+
</Files>
|
29
|
+
"""
|
30
|
+
|
31
|
+
Scenario: change web root and copy a local .htaccess file into it
|
32
|
+
Given a directory named "web_root"
|
33
|
+
When I extend the development capistrano configuration variable local_web_root_path with value 'web_root'
|
34
|
+
And I successfully run `cap dev apache:htaccess`
|
35
|
+
Then a file named "web_root/.htaccess" should exist
|
@@ -0,0 +1,100 @@
|
|
1
|
+
Feature: Test tasks for namespace 'assets'
|
2
|
+
|
3
|
+
Background:
|
4
|
+
Given a test app with the default configuration
|
5
|
+
|
6
|
+
Scenario: Check if compass files are compiled into the configured folder
|
7
|
+
Given the remote server is cleared
|
8
|
+
And the project is deployed
|
9
|
+
And I extend the development capistrano configuration from the fixture file custom_compass_sources.rb
|
10
|
+
When I successfully run `cap dev assets:compile_compass`
|
11
|
+
Then a file named "htdocs/stylesheets/test1/css/source.css" should exist
|
12
|
+
And a file named "htdocs/stylesheets/test2/css/source.css" should exist
|
13
|
+
|
14
|
+
Scenario: Check if compass files are compiled given by command line
|
15
|
+
Given the remote server is cleared
|
16
|
+
And the project is deployed
|
17
|
+
When I successfully run `cap dev "assets:compile_compass['htdocs/stylesheets/test1']"`
|
18
|
+
Then a file named "htdocs/stylesheets/test1/css/source.css" should exist
|
19
|
+
|
20
|
+
Scenario: Check if compass files are compiled given by command line with arguments
|
21
|
+
Given the remote server is cleared
|
22
|
+
And the project is deployed
|
23
|
+
When I successfully run `cap dev "assets:compile_compass['htdocs/stylesheets/test1','--boring']"`
|
24
|
+
Then a file named "htdocs/stylesheets/test1/css/source.css" should exist
|
25
|
+
And the output should contain "--boring"
|
26
|
+
|
27
|
+
Scenario: Check if compass files are compiled with pre defined arguments
|
28
|
+
Given the remote server is cleared
|
29
|
+
And the project is deployed
|
30
|
+
And I extend the development capistrano configuration variable compass_compile_arguments with value ['--boring', '--environment', 'production']
|
31
|
+
When I successfully run `cap dev "assets:compile_compass['htdocs/stylesheets/test1']"`
|
32
|
+
Then a file named "htdocs/stylesheets/test1/css/source.css" should exist
|
33
|
+
And the output should contain "--boring"
|
34
|
+
|
35
|
+
Scenario: Check if the htpasswd file is created with the correct data
|
36
|
+
Given the remote server is cleared
|
37
|
+
And I run `cap dev assets:add_htpasswd` interactively
|
38
|
+
And I type "dkd_test_user"
|
39
|
+
And I type "dkd_test_password"
|
40
|
+
And I close the stdin stream
|
41
|
+
Then the exit status should be 0
|
42
|
+
And a remote file named "shared_path/.htpasswd" should exist
|
43
|
+
|
44
|
+
Scenario: Check if cleanup is really cleaning fileadmin and uploads
|
45
|
+
Given the remote server is cleared
|
46
|
+
And the project is deployed
|
47
|
+
When I successfully run `cap dev assets:cleanup`
|
48
|
+
Given a remote empty file named "assets_path/fileadmin/example.png"
|
49
|
+
Then a remote file named "assets_path/fileadmin/example.png" should exist
|
50
|
+
When I successfully run `cap dev assets:cleanup`
|
51
|
+
Then a remote file named "assets_path/fileadmin/example.png" should not exist
|
52
|
+
|
53
|
+
Scenario: Check if download is getting archives from the remote server
|
54
|
+
Given the remote server is cleared
|
55
|
+
And the project is deployed
|
56
|
+
When I successfully run `cap dev assets:cleanup`
|
57
|
+
Given a remote empty file named "assets_path/fileadmin/example.png"
|
58
|
+
And a remote empty file named "assets_path/fileadmin/folder/example3.png"
|
59
|
+
And a remote empty file named "assets_path/uploads/example3.png"
|
60
|
+
When I run `cap dev assets:download`
|
61
|
+
Then a file named "temp/assets/uploads.tar.gz" should exist
|
62
|
+
And a file named "temp/assets/fileadmin.tar.gz" should exist
|
63
|
+
|
64
|
+
Scenario: Check if update is filling the remote server from the local archives
|
65
|
+
Given the remote server is cleared
|
66
|
+
And the project is deployed
|
67
|
+
When I successfully run `cap dev assets:cleanup`
|
68
|
+
Given a remote empty file named "assets_path/fileadmin/file.html"
|
69
|
+
And a remote empty file named "assets_path/uploads/subdirectory/file2.html"
|
70
|
+
And a remote empty file named "assets_path/uploads/file3.html"
|
71
|
+
When I successfully run `cap dev assets:download`
|
72
|
+
And I successfully run `cap dev assets:cleanup`
|
73
|
+
Then a remote file named "assets_path/fileadmin/file.html" should not exist
|
74
|
+
And a remote file named "assets_path/uploads/subdirectory/file2.html" should not exist
|
75
|
+
And a remote file named "assets_path/uploads/file3.html" should not exist
|
76
|
+
When I successfully run `cap dev assets:update`
|
77
|
+
And a remote file named "assets_path/fileadmin/file.html" should exist
|
78
|
+
And a remote file named "assets_path/uploads/subdirectory/file2.html" should exist
|
79
|
+
And a remote file named "assets_path/uploads/file3.html" should exist
|
80
|
+
|
81
|
+
Scenario: Check if add_default_content is filling the remote server from the local preseeds
|
82
|
+
Given the remote server is cleared
|
83
|
+
And the project is deployed
|
84
|
+
When I successfully run `cap dev assets:cleanup`
|
85
|
+
And I successfully run `cap dev assets:add_default_content`
|
86
|
+
Then a remote file named "assets_path/fileadmin/file1.html" should exist
|
87
|
+
And a remote file named "assets_path/fileadmin/subdirectory/file2.html" should exist
|
88
|
+
And a remote file named "assets_path/uploads/test.png" should exist
|
89
|
+
|
90
|
+
Scenario: Check if the exclude file is functioning
|
91
|
+
Given the remote server is cleared
|
92
|
+
And the project is deployed
|
93
|
+
When I successfully run `cap dev assets:cleanup`
|
94
|
+
Given a remote empty file named "assets_path/fileadmin/should_be_excluded.txt"
|
95
|
+
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should exist
|
96
|
+
When I successfully run `cap dev assets:download`
|
97
|
+
And I successfully run `cap dev assets:cleanup`
|
98
|
+
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should not exist
|
99
|
+
When I successfully run `cap dev assets:update`
|
100
|
+
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should not exist
|