depengine 3.0.10 → 3.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/depengine/dsl/publisher.rb +11 -10
- data/lib/depengine/dsl/remote.rb +6 -16
- data/lib/depengine/publisher/ssh.rb +12 -8
- data/lib/depengine/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 699d0a17010d5fa884d2f5b49b56647a4c31eaa0
|
4
|
+
data.tar.gz: e1554472b1b379b8c556ed600cc26e95abb34b2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0ec9e982df1c7b7c15b873e226acb884b23e754354661c166778b6adb815cc95ab02878c3b76570efb28873855314a5b73506cbcfde794f79e37350afad836
|
7
|
+
data.tar.gz: 9d536acdaf7a4c80d8a96ff855a86ff3b60063463944b1938c859412270618d456b4f46ddd7361db4032e3c159ded0e024fe80185264cc2dbf84d2f99e76ec83
|
@@ -25,11 +25,10 @@ module Deployment
|
|
25
25
|
publisher = ::Publisher::Sftp.new
|
26
26
|
publisher.remote_host = options[:remote_host] || @cdb['remote_host']
|
27
27
|
publisher.remote_user = options[:remote_user] || @cdb['remote_user']
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
28
|
+
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
29
|
+
|
30
|
+
publisher.ssh_key_file = File.join(File.dirname($exec_file_path), \
|
31
|
+
publisher.ssh_key_file)
|
33
32
|
|
34
33
|
Helper.validates_presence_of publisher.remote_host, "Remote host not set"
|
35
34
|
Helper.validates_presence_of publisher.remote_user, "Remote user not set"
|
@@ -46,11 +45,13 @@ module Deployment
|
|
46
45
|
publisher = ::Publisher::Sftp.new
|
47
46
|
publisher.remote_host = options[:remote_host] || @cdb['remote_host']
|
48
47
|
publisher.remote_user = options[:remote_user] || @cdb['remote_user']
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
48
|
+
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
49
|
+
|
50
|
+
publisher.ssh_key_file = File.join(File.dirname($exec_file_path), \
|
51
|
+
publisher.ssh_key_file)
|
52
|
+
|
53
|
+
Helper.validates_presence_of publisher.remote_host, "Remote host not set"
|
54
|
+
Helper.validates_presence_of publisher.remote_user, "Remote user not set"
|
54
55
|
|
55
56
|
publisher.chmod(path, permissions, options)
|
56
57
|
end
|
data/lib/depengine/dsl/remote.rb
CHANGED
@@ -9,12 +9,7 @@ module Deployment
|
|
9
9
|
publisher = ::Publisher::Ssh.new
|
10
10
|
publisher.remote_host = options[:remote_host] || @cdb['remote_host']
|
11
11
|
publisher.remote_user = options[:remote_user] || @cdb['remote_user']
|
12
|
-
|
13
|
-
publisher.ssh_key_file = File.join($recipe_config[:recipe_base_dir] || $recipe_config[:deploy_home], options[:ssh_key_file] || @cdb['ssh_key_file'])
|
14
|
-
else
|
15
|
-
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
16
|
-
end
|
17
|
-
|
12
|
+
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
18
13
|
publisher.remote_execute(command)
|
19
14
|
end
|
20
15
|
|
@@ -28,11 +23,10 @@ module Deployment
|
|
28
23
|
publisher = ::Publisher::Rsync.new
|
29
24
|
publisher.remote_host = options[:remote_host] || @cdb['remote_host']
|
30
25
|
publisher.remote_user = options[:remote_user] || @cdb['remote_user']
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
26
|
+
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
27
|
+
|
28
|
+
# publisher.ssh_key_file = File.join(File.dirname($exec_file_path), \
|
29
|
+
# publisher.ssh_key_file)
|
36
30
|
|
37
31
|
if options[:local].nil? or options[:local] == false
|
38
32
|
Helper.validates_presence_of publisher.remote_host, "Remote host not set"
|
@@ -56,11 +50,7 @@ module Deployment
|
|
56
50
|
publisher = ::Publisher::Ssh.new
|
57
51
|
publisher.remote_host = options[:remote_host] || @cdb['remote_host']
|
58
52
|
publisher.remote_user = options[:remote_user] || @cdb['remote_user']
|
59
|
-
|
60
|
-
publisher.ssh_key_file = File.join($recipe_config[:recipe_base_dir] || $recipe_config[:deploy_home], options[:ssh_key_file] || @cdb['ssh_key_file'])
|
61
|
-
else
|
62
|
-
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
63
|
-
end
|
53
|
+
publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
|
64
54
|
publisher.remove_old_releases(path, num_of_releases_to_keep, release_name_shema)
|
65
55
|
end
|
66
56
|
|
@@ -1,24 +1,28 @@
|
|
1
1
|
module Publisher
|
2
2
|
class Ssh
|
3
|
-
attr_accessor :remote_user
|
3
|
+
attr_accessor :remote_user
|
4
|
+
attr_accessor :remote_host
|
5
|
+
attr_accessor :ssh_key_file
|
4
6
|
|
5
7
|
def remote_execute(command)
|
6
|
-
Helper.validates_presence_of
|
7
|
-
Helper.validates_presence_of
|
8
|
-
Helper.validates_presence_of
|
8
|
+
Helper.validates_presence_of remote_user, "Remote User not set"
|
9
|
+
Helper.validates_presence_of remote_host, "Remote Host not set"
|
10
|
+
Helper.validates_presence_of ssh_key_file, "SSH keyfile not set"
|
9
11
|
Helper.validates_presence_of command, "No valid remote command given"
|
10
12
|
|
11
|
-
result
|
13
|
+
result = ''
|
14
|
+
# joined_filename = File.join(File.dirname($exec_file_path), ssh_key_file)
|
15
|
+
# ssh_key_file = joined_filename
|
12
16
|
|
13
|
-
if not File.file?
|
14
|
-
$log.writer.error "Can not find SSH keyfile #{
|
17
|
+
if not File.file? ssh_key_file
|
18
|
+
$log.writer.error "Can not find SSH keyfile #{ssh_key_file}"
|
15
19
|
exit 1
|
16
20
|
end
|
17
21
|
|
18
22
|
Net::SSH.start(remote_host, remote_user, \
|
19
23
|
:auth_methods => ['publickey'], \
|
20
24
|
:forward_agent => true, \
|
21
|
-
:keys =>
|
25
|
+
:keys => ssh_key_file, \
|
22
26
|
:timeout => 30 ) do |session|
|
23
27
|
session.open_channel do |ch|
|
24
28
|
ch.exec command do |ch, success|
|
data/lib/depengine/version.rb
CHANGED
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.11
|
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-04-
|
11
|
+
date: 2014-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|