depengine 3.0.15 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/depengine/dsl/local_execute.rb +9 -0
- data/lib/depengine/processor/local_execute.rb +17 -0
- data/lib/depengine/version.rb +1 -1
- data/spec/local_execute.rb +23 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b96ecb0cf183aae7846a6240036f16998ab91b0f
|
4
|
+
data.tar.gz: 0d9016d8f30a24c4718cb8f1f9ef8668281c9cd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff66fab2935e997dc61e42f49993dca802aea82032c73d06781441b9c0a8ced09751797815c0249b7f32b4f28a24fc189bda2093600652fcc20d1a3a9d054b95
|
7
|
+
data.tar.gz: 45d0c0e0466168ab793969a5a350eb5a453fc779adddc2484e446e2c74ed4470bbde26c6bf5854ad87177db265281f8f1663a750813a6f938c536526a0568bcc
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Processor
|
2
|
+
|
3
|
+
def local_execute(shell_cmds)
|
4
|
+
shell_cmds.each do |shell_cmd|
|
5
|
+
$log.writer.debug "executing: #{shell_cmd}"
|
6
|
+
output = %x[ /bin/bash --login -c \"#{shell_cmd}\" ]
|
7
|
+
if $?.exitstatus == 0
|
8
|
+
$log.writer.debug output
|
9
|
+
else
|
10
|
+
$log.writer.error output
|
11
|
+
exit 1
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
module_function :local_execute
|
16
|
+
|
17
|
+
end
|
data/lib/depengine/version.rb
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'log4r'
|
3
|
+
require 'tmpdir'
|
4
|
+
require_relative '../lib/depengine/processor/local_execute'
|
5
|
+
require_relative '../lib/depengine/log/log'
|
6
|
+
|
7
|
+
$log = Log::DeploymentLogger.new
|
8
|
+
$log.writer.level = Log4r::ERROR
|
9
|
+
|
10
|
+
describe "the local executor" do
|
11
|
+
include Processor
|
12
|
+
|
13
|
+
it "should execute commands locally" do
|
14
|
+
tmp_dir = Dir.mktmpdir
|
15
|
+
begin
|
16
|
+
local_execute(["touch #{tmp_dir}/dummy1","touch #{tmp_dir}/dummy2","ls -la #{tmp_dir}"])
|
17
|
+
expect(File.file?(File.join(tmp_dir,'dummy1'))).to be_truthy
|
18
|
+
expect(File.file?(File.join(tmp_dir,'dummy2'))).to be_truthy
|
19
|
+
ensure
|
20
|
+
FileUtils.remove_entry tmp_dir
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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.16
|
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-07-
|
11
|
+
date: 2014-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -222,6 +222,7 @@ files:
|
|
222
222
|
- lib/depengine/dsl/fileops.rb
|
223
223
|
- lib/depengine/dsl/helper.rb
|
224
224
|
- lib/depengine/dsl/iis.rb
|
225
|
+
- lib/depengine/dsl/local_execute.rb
|
225
226
|
- lib/depengine/dsl/patch.rb
|
226
227
|
- lib/depengine/dsl/publisher.rb
|
227
228
|
- lib/depengine/dsl/remote.rb
|
@@ -238,6 +239,7 @@ files:
|
|
238
239
|
- lib/depengine/log/log.rb
|
239
240
|
- lib/depengine/processor/erb_template.rb
|
240
241
|
- lib/depengine/processor/fileops.rb
|
242
|
+
- lib/depengine/processor/local_execute.rb
|
241
243
|
- lib/depengine/processor/properties.rb
|
242
244
|
- lib/depengine/processor/sed.rb
|
243
245
|
- lib/depengine/processor/tags.rb
|
@@ -267,6 +269,7 @@ files:
|
|
267
269
|
- spec/fileops_spec.rb
|
268
270
|
- spec/helper_spec.rb
|
269
271
|
- spec/junit.rb
|
272
|
+
- spec/local_execute.rb
|
270
273
|
- spec/log_spec.rb
|
271
274
|
- spec/properties/source/config.properties
|
272
275
|
- spec/properties/source/random.rb
|