Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Commit

Permalink
Merge branch 'release/9.0.0'
Browse files Browse the repository at this point in the history
* release/9.0.0: (34 commits)
  prepare release v9.0.0
  relaxed dependencies, use latest Ruby versions, appended contributors list
  print error message in InteractionHandler
  Edit changelog file for changing some SCM roles from app to all.
  close #14 change roles from app to all.
  close #31 update capistrano from 3.8.0 to 3.9.0.
  Change configuration variable additional_ignore_tables from type string to array.
  Remove TYPO3 specific configuration.
  Update changelog
  Remove feature to extend release path with jenkins prefix
  Remove include of sshkit dsl
  Update capistrano to 3.8.0
  fix travis ci badge link
  rubocop 0.50 upgrade
  Install mysql instead of mysql-connector-c, because mysql-connector-c is broken.
  Add vagrant 2.0.x support
  declare target Ruby version in RuboCop configuration
  updated dependencies
  Remove the fixed sshkit dependency to version 1.10.0
  Updated copyright
  ...
  • Loading branch information
ncreuschling committed Oct 16, 2017
2 parents f03ffc3 + 0675377 commit 64bb2e2
Show file tree
Hide file tree
Showing 49 changed files with 541 additions and 371 deletions.
9 changes: 9 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ AllCops:
- 'spec/fixtures/application/htdocs/stylesheets/**/config.rb'
- 'config/**/*'
- 'Vagrantfile'
- 'vendor/**/*'
TargetRubyVersion: 2.2
ExtraDetails: true
DisplayStyleGuide: true
DisplayCopNames: true
GlobalVars:
AllowedVariables: []
MethodLength:
Expand All @@ -16,3 +21,7 @@ BracesAroundHashParameters:
Enabled: false
CyclomaticComplexity:
Max: 10
Metrics/BlockLength:
Enabled: false
Style/FormatStringToken:
Enabled: false
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo: false
language: ruby
cache: bundler
rvm:
- 2.2
- 2.3
- 2.4

before_install:
- gem install bundler --no-document

script:
- bundle exec rubocop
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Changelog
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [9.0.0]
### Summary

- tasks around MySQL slow log
- add `utils:create_local_temp_directory` task
- support for dkdeploy-test_environment v2.0.0
- Vagrant 2.0.x support
- rubocop upgrade to 0.50
- update capistrano to v3.9.0
- remove jenkins release suffix
- configuration option `additional_ignore_tables` changes from `string` to `array`
- set group permissions for `/var/www` in Chef cookbook (Vagrant)
- set proper gem homepage
- add travis support
- improved code syntax according to RuboCop
- install `mysql` instead of `mysql-connector-c`
- remove sshkit dsl includes
- remove TYPO3 specific configuration
- change some SCM roles from app to all

## [8.0.1] - 2017-05-15
### Summary

- hotfix for GH25: erroneous Capistrano scope

## [8.0.0] - 2016-06-20
### Summary

- first public release

[Unreleased]: https://github.com/dkdeploy/dkdeploy-core/compare/master...develop
[9.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v9.0.0
[8.0.1]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.1
[8.0.0]: https://github.com/dkdeploy/dkdeploy-core/releases/tag/v8.0.0
2 changes: 2 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

The dkdeploy core maintainers would like to recognize following contributors (in alphabetic order):

- Jan Bergmann
- Dimitri Ebert
- Sascha Egerer
- Christoph Gerold
- Johannes Goslar
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2014-2016 dkd Internet Service GmbH, Frankfurt am Main (Germany), https://dkd.de/
Copyright (c) 2014-2017 dkd Internet Service GmbH, Frankfurt am Main (Germany), https://dkd.de/

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:

Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Dkdeploy::Core
![dkdeploy](assets/dkdeploy-logo.png)

[![Gem Version](https://badge.fury.io/rb/dkdeploy-core.svg)](https://badge.fury.io/rb/dkdeploy-core)
# dkdeploy::core

[![Build Status](https://travis-ci.org/dkdeploy/dkdeploy-core.svg?branch=develop)](https://travis-ci.org/dkdeploy/dkdeploy-core)
[![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)

## Description

Expand All @@ -10,7 +13,7 @@ This Rubygem `dkdeploy-core` represents the extension of [Capistrano](http://cap

Add this line to your application's `Gemfile`

gem 'dkdeploy-core', '~> 8.0'
gem 'dkdeploy-core', '~> 9.0'

and then execute

Expand Down Expand Up @@ -61,7 +64,7 @@ The complete list of the dkdeploy constants you find in `/lib/capistrano/dkdeplo

### Prerequisite

rvm (v1.25.x) with installed Ruby 2.1.
rvm (v1.29.x) with installed Ruby 2.2.

Add the virtual box alias to your `hosts` file

Expand All @@ -76,7 +79,7 @@ Add the virtual box alias to your `hosts` file
## Contributing

1. Install [git flow](https://github.com/nvie/gitflow)
2. Install [Homebrew](http://brew.sh/) and run `brew install mysql-connector-c`
2. Install [Homebrew](http://brew.sh/) and run `brew install mysql`
3. Install [NodeJS](https://nodejs.org) (supported: v0.12.7) via `brew install nodejs`
4. Install [Bower](http://bower.io) (supported: v1.7.9) via `npm install -g [email protected]`
5. If project is not checked out already do git clone `[email protected]:dkdeploy/dkdeploy-core.git`
Expand Down
13 changes: 3 additions & 10 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ unless Vagrant.has_plugin?('vagrant-berkshelf')
abort
end

unless Vagrant.has_plugin?('vagrant-omnibus')
puts "Please install vagrant plugin vagrant-omnibus first\n"
puts " vagrant plugin install vagrant-omnibus\n\n"
puts "Exit vagrant\n\n"
abort
end

Vagrant.require_version '~> 1.8.1'
Vagrant.require_version '~> 2.0.0'
chef_version = '12.9.41'

Vagrant.configure(2) do |config|
Expand All @@ -23,15 +16,15 @@ Vagrant.configure(2) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.box_check_update = false
config.berkshelf.enabled = true
config.omnibus.chef_version = chef_version

config.vm.define('dkdeploy-core', primary: true) do |master_config|
master_config.vm.network 'private_network', ip: ip_address

# Chef settings
master_config.vm.provision :chef_solo do |chef|
chef.install = true
chef.channel = 'stable'
chef.version = chef_version
chef.install = false # omnibus does it already
chef.log_level = :info
chef.add_recipe 'dkdeploy-core'
end
Expand Down
Binary file added assets/dkdeploy-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion config/vm/cookbooks/dkdeploy-core/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@
# Need for remote connection
bind_address '0.0.0.0'
action [:create, :start]
run_group 'vagrant'
run_user 'vagrant'
end

mysql_config 'default' do
instance 'default' # necessary in some cases, causes hanging on provisioning https://github.com/chef-cookbooks/mysql/issues/387
# use different user to allow capistrano access to log file
owner 'vagrant'
group 'vagrant'
source 'my_extra_settings.erb'
notifies :restart, 'mysql_service[default]'
action :create
end

mysql2_chef_gem 'default' do
Expand Down Expand Up @@ -50,7 +62,7 @@

directory '/var/www' do
owner 'vagrant'
owner 'vagrant'
group 'vagrant'
mode '0770'
action :create
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[mysqld]
# configure mysql to produce log with slow queries
# log-output = /var/log/mysql-default/
slow_query_log = 1
# log file - needs to match :mysql_slow_log in deploy.rb of fixture
slow_query_log_file = /var/log/mysql-default/slow-queries.log
23 changes: 11 additions & 12 deletions dkdeploy-core.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'dkdeploy/core/version'
Expand All @@ -7,28 +6,28 @@ Gem::Specification.new do |spec|
spec.name = 'dkdeploy-core'
spec.version = Dkdeploy::Core::Version
spec.license = 'MIT'
spec.authors = ['Lars Tode', 'Timo Webler', 'Kieran Hayes', 'Nicolai Reuschling', 'Johannes Goslar', 'Luka Lüdicke']
spec.email = %w([email protected] [email protected] [email protected] [email protected] [email protected] [email protected])
spec.authors = ['Timo Webler', 'Nicolai Reuschling']
spec.email = %w[[email protected] [email protected]]
spec.description = 'dkd basic deployment tasks and strategies'
spec.summary = 'dkd basic deployment tasks and strategies'
spec.homepage = 'https://redmine.dkd.de/projects/dkdeploy/wiki'
spec.homepage = 'https://github.com/dkdeploy/dkdeploy-core'
spec.required_ruby_version = '~> 2.2'

spec.files = `git ls-files`.split($/)
spec.executables = spec.files.grep(%r{^bin\/}) { |f| File.basename(f) }
spec.test_files = spec.files.grep(%r{^(test|spec|features)\/})
spec.require_paths = ['lib']

spec.add_development_dependency 'bundler', '~> 1.12.5'
spec.add_development_dependency 'rake', '~> 11.2'
spec.add_development_dependency 'rspec', '~> 3.4'
spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake'
spec.add_development_dependency 'rspec', '~> 3.5'
spec.add_development_dependency 'cucumber', '~> 2.4'
spec.add_development_dependency 'rubocop', '~> 0.40'
spec.add_development_dependency 'rubocop', '~> 0.50.0'
spec.add_development_dependency 'aruba', '~> 0.14.1'
spec.add_development_dependency 'mysql2', '~> 0.3'
spec.add_development_dependency 'pry', '~> 0.10.3'
spec.add_development_dependency 'dkdeploy-test_environment', '~> 1.0'
spec.add_development_dependency 'pry', '~> 0.10'
spec.add_development_dependency 'dkdeploy-test_environment', '~> 2.0'

spec.add_dependency 'capistrano', '~> 3.5.0'
spec.add_dependency 'sshkit', '= 1.10.0'
spec.add_dependency 'capistrano', '~> 3.9.0'
spec.add_dependency 'highline', '~> 1.7.1'
end
50 changes: 24 additions & 26 deletions features/assets.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,60 +41,58 @@ Feature: Test tasks for namespace 'assets'
Then the exit status should be 0
And a remote file named "shared_path/.htpasswd" should exist

Scenario: Check if cleanup is really cleaning fileadmin and uploads
Scenario: Check if cleanup is really cleaning downloads
Given the remote server is cleared
And the project is deployed
When I successfully run `cap dev assets:cleanup`
Given a remote empty file named "assets_path/fileadmin/example.png"
Then a remote file named "assets_path/fileadmin/example.png" should exist
Given a remote empty file named "assets_path/download/example.png"
Then a remote file named "assets_path/download/example.png" should exist
When I successfully run `cap dev assets:cleanup`
Then a remote file named "assets_path/fileadmin/example.png" should not exist
Then a remote file named "assets_path/download/example.png" should not exist

Scenario: Check if download is getting archives from the remote server
Given the remote server is cleared
And the project is deployed
When I successfully run `cap dev assets:cleanup`
Given a remote empty file named "assets_path/fileadmin/example.png"
And a remote empty file named "assets_path/fileadmin/folder/example3.png"
And a remote empty file named "assets_path/uploads/example3.png"
When I run `cap dev assets:download`
Then a file named "temp/assets/uploads.tar.gz" should exist
And a file named "temp/assets/fileadmin.tar.gz" should exist
And a remote empty file named "assets_path/download/example.png"
And a remote empty file named "assets_path/download/folder/example3.png"
And I run `cap dev assets:download`
Then a file named "temp/assets/download.tar.gz" should exist

Scenario: Check if update is filling the remote server from the local archives
Given the remote server is cleared
And the project is deployed
When I successfully run `cap dev assets:cleanup`
Given a remote empty file named "assets_path/fileadmin/file.html"
And a remote empty file named "assets_path/uploads/subdirectory/file2.html"
And a remote empty file named "assets_path/uploads/file3.html"
Then a remote empty file named "assets_path/download/file.html"
And a remote empty file named "assets_path/download/subdirectory/file2.html"
And a remote empty file named "assets_path/download/file3.html"
When I successfully run `cap dev assets:download`
And I successfully run `cap dev assets:cleanup`
Then a remote file named "assets_path/fileadmin/file.html" should not exist
And a remote file named "assets_path/uploads/subdirectory/file2.html" should not exist
And a remote file named "assets_path/uploads/file3.html" should not exist
Then a remote file named "assets_path/download/file.html" should not exist
And a remote file named "assets_path/download/subdirectory/file2.html" should not exist
And a remote file named "assets_path/download/file3.html" should not exist
When I successfully run `cap dev assets:update`
And a remote file named "assets_path/fileadmin/file.html" should exist
And a remote file named "assets_path/uploads/subdirectory/file2.html" should exist
And a remote file named "assets_path/uploads/file3.html" should exist
And a remote file named "assets_path/download/file.html" should exist
And a remote file named "assets_path/download/subdirectory/file2.html" should exist
And a remote file named "assets_path/download/file3.html" should exist

Scenario: Check if add_default_content is filling the remote server from the local preseeds
Given the remote server is cleared
And the project is deployed
When I successfully run `cap dev assets:cleanup`
And I successfully run `cap dev assets:add_default_content`
Then a remote file named "assets_path/fileadmin/file1.html" should exist
And a remote file named "assets_path/fileadmin/subdirectory/file2.html" should exist
And a remote file named "assets_path/uploads/test.png" should exist
Then a remote file named "assets_path/download/file1.html" should exist
And a remote file named "assets_path/download/subdirectory/file2.html" should exist
And a remote file named "assets_path/download/test.png" should exist

Scenario: Check if the exclude file is functioning
Given the remote server is cleared
And the project is deployed
When I successfully run `cap dev assets:cleanup`
Given a remote empty file named "assets_path/fileadmin/should_be_excluded.txt"
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should exist
Given a remote empty file named "assets_path/download/should_be_excluded.txt"
Then a remote file named "assets_path/download/should_be_excluded.txt" should exist
When I successfully run `cap dev assets:download`
And I successfully run `cap dev assets:cleanup`
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should not exist
Then a remote file named "assets_path/download/should_be_excluded.txt" should not exist
When I successfully run `cap dev assets:update`
Then a remote file named "assets_path/fileadmin/should_be_excluded.txt" should not exist
Then a remote file named "assets_path/download/should_be_excluded.txt" should not exist
4 changes: 4 additions & 0 deletions features/db.feature
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,7 @@ Feature: Test tasks for namespace 'db'
And I successfully run `cap dev db:add_default_content`
And I wait 5 second to let the database commit the transaction
Then the database should have a value `first preseed value` in table `preseed_table` for column `value`

Scenario: Check error answer of a broken SQL syntax
When I run `cap dev "db:sql_error"`
Then the output should match /ERROR 1064/
27 changes: 27 additions & 0 deletions features/mysql.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Feature: Test tasks for namespace 'mysql'

Background:
Given a test app with the default configuration
And the remote server is cleared
And I want to use the database `dkdeploy_core`

Scenario: Downloading the MYSQL slow log
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
And I successfully run `cap dev db:download_content`
And I successfully run `cap dev mysql:download_slow_log`
Then a file named "temp/slow-queries.dev.dkdeploy-core.dev.log" should exist

Scenario: Downloading the MYSQL slow log analyze file
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
And I successfully run `cap dev db:download_content`
And I successfully run `cap dev mysql:analyze_download_slow_log`
Then a file named "temp/mysql_slow_log_analyze.dev.dkdeploy-core.dev.log" should exist

Scenario: Clearing the MySQL slow log file
When I successfully run `cap dev "db:upload_settings[127.0.0.1,3306,dkdeploy_core,root,ilikerandompasswords,utf8]"`
And I successfully run `cap dev "db:update[temp,dkdeploy_core.sql.gz]"`
And I successfully run `cap dev db:download_content`
And I successfully run `cap dev mysql:clear_slow_log`
Then the output should match /has been cleared/
2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@
# The official way via Bundler.with_clean_env did not work properly here
Aruba.configure do |config|
config.command_runtime_environment = { 'BUNDLE_GEMFILE' => File.join(TEST_APPLICATION.test_app_path, 'Gemfile') }
config.exit_timeout = 10
config.exit_timeout = 30
end
Loading

0 comments on commit 64bb2e2

Please sign in to comment.