depengine 3.0.13 → 3.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -1
- data/bin/full_install +4 -3
- data/depengine.gemspec +1 -0
- data/lib/depengine/cli.rb +5 -0
- data/lib/depengine/helper/cli_helper.rb +58 -0
- data/lib/depengine/processor/properties.rb +9 -2
- data/lib/depengine/version.rb +1 -1
- data/spec/junit.rb +90 -0
- metadata +19 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a134bda5edc62ec7717ac06c2aef9c71bbc2d2e
|
4
|
+
data.tar.gz: 0fd221facd7fd5ea5002ffbdff41b6269010017a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 733b1e3bf0234b75da148262cd2d91dc905f84ddaa0f468196724330215e8bf0b137263caa06367bdc1fcfcf0b078ed83a4dff32bfb11ea4bdf1562332747a67
|
7
|
+
data.tar.gz: bfda217511f8b553beed3e8a837afb34cf7a1f5ef696cae8fc5dfe0d6894395c29552eda19288852465ed9878152e0b8bbe5ab1ddb96fc27aa91f299155417e5
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
depengine (3.0.
|
4
|
+
depengine (3.0.13)
|
5
5
|
expect4r (~> 0.0)
|
6
6
|
json (~> 1.4)
|
7
7
|
log4r (~> 1.1)
|
@@ -15,6 +15,7 @@ PATH
|
|
15
15
|
GEM
|
16
16
|
remote: https://rubygems.org/
|
17
17
|
specs:
|
18
|
+
builder (3.2.2)
|
18
19
|
diff-lcs (1.1.3)
|
19
20
|
expect4r (0.0.10)
|
20
21
|
highline (>= 1.5.0)
|
@@ -60,6 +61,7 @@ PLATFORMS
|
|
60
61
|
ruby
|
61
62
|
|
62
63
|
DEPENDENCIES
|
64
|
+
builder (~> 3.2.0)
|
63
65
|
depengine!
|
64
66
|
fakefs (~> 0.5)
|
65
67
|
rspec (~> 2)
|
data/bin/full_install
CHANGED
@@ -35,9 +35,10 @@ done
|
|
35
35
|
export rvm_path=$TOOLROOT/rvm
|
36
36
|
mkdir -p $rvm_path
|
37
37
|
|
38
|
-
if [ ! -f $rvm_path/scripts/rvm ]; then
|
39
|
-
|
40
|
-
|
38
|
+
if [ ! -f $rvm_path/scripts/rvm ]; then
|
39
|
+
echo "installing RVM..."
|
40
|
+
bash -s stable < <(curl -s -L "https://get.rvm.io")
|
41
|
+
fi
|
41
42
|
|
42
43
|
source $rvm_path/scripts/rvm
|
43
44
|
rvm reload
|
data/depengine.gemspec
CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.add_development_dependency "rspec", "~> 2"
|
29
29
|
s.add_development_dependency "fakefs", '~> 0.5'
|
30
30
|
s.add_development_dependency "sinatra", '~> 1.4'
|
31
|
+
s.add_development_dependency "builder", '~> 3.2.0'
|
31
32
|
|
32
33
|
s.files = `git ls-files`.split("\n")
|
33
34
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/depengine/cli.rb
CHANGED
@@ -12,6 +12,11 @@ module Depengine
|
|
12
12
|
args.options do |o|
|
13
13
|
o.banner = "Usage: #{File.basename($0)} [options]"
|
14
14
|
o.separator ""
|
15
|
+
o.on('-n', '--new [some_path]', 'create a new empty recipe directory structure') do |path|
|
16
|
+
require_relative('helper/cli_helper')
|
17
|
+
extend CLIHelper
|
18
|
+
setup_new_recipe(path ||= ".")
|
19
|
+
end
|
15
20
|
o.on('-h', '--deployhome [DIRNAME]', 'Home of deployments.') do |dname|
|
16
21
|
set :deploy_home, dname
|
17
22
|
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module CLIHelper
|
2
|
+
|
3
|
+
def setup_new_recipe(path)
|
4
|
+
puts "Setting up a new deployment recipe in #{File.expand_path(path)}"
|
5
|
+
require 'fileutils'
|
6
|
+
require 'yaml'
|
7
|
+
FileUtils.mkdir_p(File.expand_path(path))
|
8
|
+
FileUtils.cd(File.expand_path(path))
|
9
|
+
%w{cdb config recipe}.each {|d| FileUtils.mkdir_p d}
|
10
|
+
%w{DEV PROD}.each do |env|
|
11
|
+
FileUtils.mkdir_p "cdb/#{env}"
|
12
|
+
File.open("cdb/#{env}.yaml","w") {|f| f.write env_yaml("DEV")}
|
13
|
+
File.open("cdb/#{env}/demoapplication.yaml","w") {|f| f.write application_yaml}
|
14
|
+
end
|
15
|
+
FileUtils.touch("config/some_file_that_is_needed_for_the_deployment.jar")
|
16
|
+
File.open("recipe/deploy.rb","w") {|f| f.write deploy_recipe_template}
|
17
|
+
exit 0
|
18
|
+
end
|
19
|
+
|
20
|
+
def env_yaml(env)
|
21
|
+
{ 'env' => env,
|
22
|
+
'projektname' => 'Demoproject',
|
23
|
+
'remote_user' => 'szzdep'
|
24
|
+
}.to_yaml
|
25
|
+
end
|
26
|
+
|
27
|
+
def application_yaml
|
28
|
+
{ 'taskname' => 'A demo applicaition deployment',
|
29
|
+
'app_hosts' => ['appserv01', 'appserv02'],
|
30
|
+
'deploy_path' => '/some/path/to/deploy/to/',
|
31
|
+
'patch_properties' => {'test.message' => 'foo'}
|
32
|
+
}.to_yaml
|
33
|
+
end
|
34
|
+
|
35
|
+
def deploy_recipe_template
|
36
|
+
%{set :application_name, "The Demo Application"
|
37
|
+
# The module_name is used to select the correct file from cdb/$env/
|
38
|
+
set :module_name, "demoapplication"
|
39
|
+
|
40
|
+
set :log_level, "INFO"
|
41
|
+
set :log_file, "deploy.log"
|
42
|
+
set :log_file_level, "DEBUG"
|
43
|
+
|
44
|
+
Deployment.deliver do
|
45
|
+
config = get_all_config_parameters
|
46
|
+
|
47
|
+
config['app_hosts'].each do |host|
|
48
|
+
$log.writer.info "Copying .war to \#{host}..."
|
49
|
+
rsync("target/some_application.war", config['deploy_path'], :remote_host => host)
|
50
|
+
$log.writer.info "Restarting app servers..."
|
51
|
+
remote_execute("sudo /etc/init.d/appserver restart", :remote_host => host)
|
52
|
+
end
|
53
|
+
$log.writer.info "Done."
|
54
|
+
end
|
55
|
+
}
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -50,8 +50,15 @@ module Processor
|
|
50
50
|
if keyvalue[1].strip.empty?
|
51
51
|
entry = entry.chomp + properties_hash[keyvalue[0].strip]
|
52
52
|
else
|
53
|
-
entry =
|
54
|
-
|
53
|
+
entry = keyvalue[0] + assigner + keyvalue[1].sub(keyvalue[1].strip, properties_hash[keyvalue[0].strip])
|
54
|
+
|
55
|
+
### patch global variable
|
56
|
+
if not entry.nil? and entry.include?('<t:db_endpoint_1/>')
|
57
|
+
entry = entry.sub(/<t\:db_endpoint_1\/>/, properties_hash['db_endpoint_1'])
|
58
|
+
end
|
59
|
+
if not entry.nil? and entry.include?('<t:db_endpoint_2/>')
|
60
|
+
entry = entry.sub(/<t\:db_endpoint_2\/>/, properties_hash['db_endpoint_2'])
|
61
|
+
end
|
55
62
|
end
|
56
63
|
end
|
57
64
|
end
|
data/lib/depengine/version.rb
CHANGED
data/spec/junit.rb
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
=begin
|
2
|
+
|
3
|
+
Copyright (c) 2012, Nathaniel Ritmeyer
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
1. Redistributions of source code must retain the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright
|
13
|
+
notice, this list of conditions and the following disclaimer in the
|
14
|
+
documentation and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
3. Neither the name Nathaniel Ritmeyer nor the names of contributors to
|
17
|
+
this software may be used to endorse or promote products derived from this
|
18
|
+
software without specific prior written permission.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
|
21
|
+
IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
23
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
|
24
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
25
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
26
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
27
|
+
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
28
|
+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
29
|
+
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
30
|
+
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
31
|
+
|
32
|
+
=end
|
33
|
+
|
34
|
+
require 'time'
|
35
|
+
require 'builder'
|
36
|
+
require 'rspec/core/formatters/base_formatter'
|
37
|
+
|
38
|
+
class JUnit < RSpec::Core::Formatters::BaseFormatter
|
39
|
+
def initialize output
|
40
|
+
super output
|
41
|
+
@test_results = []
|
42
|
+
end
|
43
|
+
|
44
|
+
def example_passed example
|
45
|
+
@test_results << example
|
46
|
+
end
|
47
|
+
|
48
|
+
def example_failed example
|
49
|
+
@test_results << example
|
50
|
+
end
|
51
|
+
|
52
|
+
def example_pending example
|
53
|
+
@test_results << example
|
54
|
+
end
|
55
|
+
|
56
|
+
def failure_details_for example
|
57
|
+
exception = example.metadata[:execution_result][:exception]
|
58
|
+
exception.nil? ? "" : "#{exception.message}\n#{format_backtrace(exception.backtrace, example).join("\n")}"
|
59
|
+
end
|
60
|
+
|
61
|
+
def full_name_for example
|
62
|
+
test_name = ""
|
63
|
+
current_example_group = example.metadata[:example_group]
|
64
|
+
until current_example_group.nil? do
|
65
|
+
test_name = "#{current_example_group[:description]}." + test_name
|
66
|
+
current_example_group = current_example_group[:example_group]
|
67
|
+
end
|
68
|
+
test_name << example.metadata[:description]
|
69
|
+
end
|
70
|
+
|
71
|
+
def dump_summary duration, example_count, failure_count, pending_count
|
72
|
+
builder = Builder::XmlMarkup.new :indent => 2
|
73
|
+
builder.instruct! :xml, :version => "1.0", :encoding => "UTF-8"
|
74
|
+
builder.testsuite :errors => 0, :failures => failure_count, :skipped => pending_count, :tests => example_count, :time => duration, :timestamp => Time.now.iso8601 do
|
75
|
+
builder.properties
|
76
|
+
@test_results.each do |test|
|
77
|
+
builder.testcase :classname => full_name_for(test), :name => test.metadata[:full_description], :time => test.metadata[:execution_result][:run_time] do
|
78
|
+
case test.metadata[:execution_result][:status]
|
79
|
+
when "failed"
|
80
|
+
builder.failure :message => "failed #{test.metadata[:full_description]}", :type => "failed" do
|
81
|
+
builder.cdata! failure_details_for test
|
82
|
+
end
|
83
|
+
when "pending" then builder.skipped
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
output.puts builder.target!
|
89
|
+
end
|
90
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: depengine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Team Automatisierung
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -178,6 +178,20 @@ dependencies:
|
|
178
178
|
- - "~>"
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '1.4'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: builder
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 3.2.0
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: 3.2.0
|
181
195
|
description: Simply generates Depengine text.
|
182
196
|
email:
|
183
197
|
- team-automatisierung@sinnerschrader.com
|
@@ -215,6 +229,7 @@ files:
|
|
215
229
|
- lib/depengine/dsl/repository.rb
|
216
230
|
- lib/depengine/dsl/template.rb
|
217
231
|
- lib/depengine/dsl/zip.rb
|
232
|
+
- lib/depengine/helper/cli_helper.rb
|
218
233
|
- lib/depengine/helper/hudson.rb
|
219
234
|
- lib/depengine/helper/mail.rb
|
220
235
|
- lib/depengine/helper/properties.rb
|
@@ -252,6 +267,7 @@ files:
|
|
252
267
|
- spec/deployhelper_spec.rb
|
253
268
|
- spec/fileops_spec.rb
|
254
269
|
- spec/helper_spec.rb
|
270
|
+
- spec/junit.rb
|
255
271
|
- spec/log_spec.rb
|
256
272
|
- spec/properties/source/config.properties
|
257
273
|
- spec/properties/source/random.rb
|
@@ -302,6 +318,7 @@ test_files:
|
|
302
318
|
- spec/deployhelper_spec.rb
|
303
319
|
- spec/fileops_spec.rb
|
304
320
|
- spec/helper_spec.rb
|
321
|
+
- spec/junit.rb
|
305
322
|
- spec/log_spec.rb
|
306
323
|
- spec/properties/source/config.properties
|
307
324
|
- spec/properties/source/random.rb
|