depengine 3.0.3 → 3.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ad9268ce675daefc94dc5dfc7ae29925ac247308
4
- data.tar.gz: c23742a660ebf9d069e4d85f2a8152a22512f91a
3
+ metadata.gz: ae7ab576f40e2d40332339a33be0c20db69fac61
4
+ data.tar.gz: 2155052a6ced85ae12e4a947cecfc2904bc5a0e6
5
5
  SHA512:
6
- metadata.gz: c9f62019cbe1c68153f92206f635f26b39a6edafc09887dd5f962f676c0e2046b85b504b1937e5acd9844aec7d485402a74896193f8c285311c586e882293a61
7
- data.tar.gz: edd36baf51936a992ab912e62d144ed470149efaacd8b1252269206aa5345a8e127b394fea019adf42416a9dfe1863a3fceb66b5924c21501f31caa21ef84e82
6
+ metadata.gz: 457526ad954a12cf626a48a4e8e031fdd85098964b9854974feb2f1a857ea2b6fde56025fd9a75e9356585dd265a995779d4ccefbce345711503ea1d7c1af3da
7
+ data.tar.gz: 01c519bd8a40df40130ced31528774f04ada204e626d06f01701085ecf34bf47aef7f4e817543b76cb49db46e5c24a0d5871f5c6b97c653c95337ba0c4c84e5c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- depengine (3.0.2)
4
+ depengine (3.0.3)
5
5
  expect4r (~> 0.0)
6
6
  json (~> 1.4)
7
7
  log4r (~> 1.1)
@@ -26,7 +26,7 @@ GEM
26
26
  mime-types (~> 1.16)
27
27
  treetop (~> 1.4.8)
28
28
  mime-types (1.25.1)
29
- net-scp (1.1.2)
29
+ net-scp (1.2.0)
30
30
  net-ssh (>= 2.6.5)
31
31
  net-sftp (2.1.2)
32
32
  net-ssh (>= 2.6.5)
@@ -37,35 +37,19 @@ module Deployment
37
37
 
38
38
  load_modules!
39
39
 
40
- # read global deployment configuration from etc/config.yaml
41
- if ENV['USE_DEPENGINE_AS_GEM']
42
- deployment_configuration_file = \
43
- ( File.join(File.dirname($exec_file_path), '../../etc/config.yaml') )
44
- else
45
- deployment_configuration_file = \
46
- ( File.join(File.dirname($exec_file_path), '../etc/config.yaml') )
47
- end
48
- if File.file? deployment_configuration_file
49
- $recipe_config.merge! Helper.yaml_parse(deployment_configuration_file)
50
- else
51
- puts "Can not read deployment configuration etc/config.yaml"
52
- end
53
-
54
40
  # generate hash from environemnt variables and merge
55
- $recipe_config.merge! Helper.get_environemnt_variables($recipe_config['env_exceptions'])
41
+ $recipe_config.merge! Helper.get_environemnt_variables($recipe_config['env_exceptions'] || "LS_COLORS TERMCAP")
56
42
 
57
- # generate version hash from environment variable
58
43
  @version = Helper.parse_version($recipe_config[:version])
59
44
 
60
45
  # validate needed environment variables
61
- Helper.validates_not_empty $recipe_config[:env], \
62
- "env is not set"
63
- Helper.validates_not_empty $recipe_config[:version], \
64
- "version is not set"
65
- Helper.validates_not_empty $recipe_config[:deploy_home], \
66
- "deploy_home is not set"
46
+ Helper.validates_not_empty $recipe_config[:env], "env is not set"
47
+ Helper.validates_not_empty $recipe_config[:version], "version is not set"
48
+ Helper.validates_not_empty $recipe_config[:deploy_home], "deploy_home is not set"
67
49
 
68
50
  # read configuration from cdb
51
+ $recipe_config['cdb_host'] ||= "filesystem"
52
+ $recipe_config['cdb_context'] ||= ""
69
53
  @cdb = get_cdb_parameters(@version['cdb'])
70
54
 
71
55
  # clean workspace if needed
@@ -7,7 +7,7 @@ module Deployment
7
7
  Helper.validates_presence_of @cdb['ssh_key_file_command'], "SSH keyfile not set"
8
8
  Helper.validates_presence_of @cdb['siteid'], "Siteid not set"
9
9
 
10
- publisher = Publisher::Dweb.new
10
+ publisher = ::Publisher::Dweb.new
11
11
  publisher.staging_host = @cdb['staging_host']
12
12
  publisher.ssh_key_file = @cdb['ssh_key_file_command']
13
13
  publisher.siteid = @cdb['siteid']
@@ -21,7 +21,7 @@ module Deployment
21
21
  Helper.validates_presence_of source
22
22
  Helper.validates_presence_of target
23
23
 
24
- publisher = Publisher::Dweb.new
24
+ publisher = ::Publisher::Dweb.new
25
25
  publisher.staging_host = @cdb['staging_host']
26
26
  publisher.ssh_key_file = @cdb['ssh_key_file']
27
27
  publisher.siteid = @cdb['siteid']
@@ -34,7 +34,7 @@ module Deployment
34
34
  end
35
35
 
36
36
  def dweb_link(source, symlink, options={})
37
- publisher = Publisher::Dweb.new
37
+ publisher = ::Publisher::Dweb.new
38
38
  publisher.staging_host = @cdb['staging_host']
39
39
  publisher.ssh_key_file = @cdb['ssh_key_file']
40
40
  publisher.siteid = @cdb['siteid']
@@ -44,7 +44,7 @@ module Deployment
44
44
  end
45
45
 
46
46
  def tomcat_deploy(options={})
47
- publisher = Publisher::Tomcat.new
47
+ publisher = ::Publisher::Tomcat.new
48
48
  publisher.servers = options[:servers] || @cdb['servers']
49
49
  publisher.runners = options[:runners] || @cdb['runners'] || publisher.servers
50
50
  publisher.initd_script = options[:initd_script] || @cdb['initd_script']
@@ -16,7 +16,7 @@ module Deployment
16
16
  Helper.validates_presence_of $recipe_config['VALUE'], \
17
17
  "VALUE parameter is missing"
18
18
 
19
- iis = Publisher::Iis_build.new
19
+ iis = ::Publisher::Iis_build.new
20
20
  iis.iis_build_protocol = @cdb['iis_build_protocol']
21
21
  iis.iis_build_url = @cdb['iis_build_url']
22
22
  if @cdb['http_read_timeout']
@@ -40,7 +40,7 @@ module Deployment
40
40
  Helper.validates_presence_of @version['app'], \
41
41
  "VERSION parameter is missing"
42
42
 
43
- iis = Publisher::Iis_deploy.new
43
+ iis = ::Publisher::Iis_deploy.new
44
44
  iis.iis_deploy_protocol = @cdb['iis_deploy_protocol']
45
45
  iis.iis_deploy_url = options[:iis_deploy_url] || @cdb['iis_deploy_url']
46
46
  if @cdb['http_read_timeout']
@@ -59,7 +59,7 @@ module Deployment
59
59
  Helper.validates_presence_of $recipe_config['VALUE'], \
60
60
  "VALUE parameter is missing"
61
61
 
62
- iis = Publisher::Iis_appcmd.new
62
+ iis = ::Publisher::Iis_appcmd.new
63
63
  iis.iis_appcmd_protocol = @cdb['iis_appcmd_protocol']
64
64
  iis.iis_appcmd_url = @cdb['iis_appcmd_url']
65
65
  if @cdb['http_read_timeout']
@@ -5,7 +5,7 @@ module Deployment
5
5
  Helper.validates_presence_of source
6
6
  Helper.validates_presence_of target
7
7
 
8
- publisher = Publisher::Samba.new
8
+ publisher = ::Publisher::Samba.new
9
9
  publisher.samba_share = options[:samba_share] || @cdb['samba_share']
10
10
  publisher.worker = self
11
11
  publisher.samba_mountpoints = options[:samba_mountpoints] || @cdb['samba_mountpoints']
@@ -22,7 +22,7 @@ module Deployment
22
22
  Helper.validates_presence_of source
23
23
  Helper.validates_presence_of target
24
24
 
25
- publisher = Publisher::Sftp.new
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
28
  publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
@@ -42,7 +42,7 @@ module Deployment
42
42
  Helper.validates_presence_of path
43
43
  Helper.validates_presence_of permissions
44
44
 
45
- publisher = Publisher::Sftp.new
45
+ publisher = ::Publisher::Sftp.new
46
46
  publisher.remote_host = options[:remote_host] || @cdb['remote_host']
47
47
  publisher.remote_user = options[:remote_user] || @cdb['remote_user']
48
48
  publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
@@ -6,7 +6,7 @@ module Deployment
6
6
  Helper.validates_presence_of command, "No command to execute!"
7
7
  Helper.validates_presence_of @cdb['ssh_key_file'], "SSH keyfile not set"
8
8
 
9
- publisher = Publisher::Ssh.new
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
12
  publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
@@ -20,7 +20,7 @@ module Deployment
20
20
  Helper.validates_presence_of source
21
21
  Helper.validates_presence_of target
22
22
 
23
- publisher = Publisher::Rsync.new
23
+ publisher = ::Publisher::Rsync.new
24
24
  publisher.remote_host = options[:remote_host] || @cdb['remote_host']
25
25
  publisher.remote_user = options[:remote_user] || @cdb['remote_user']
26
26
  publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
@@ -47,7 +47,7 @@ module Deployment
47
47
 
48
48
  release_name_shema = /[0-9]{4}\-[0-9]{2}\-[0-9]{2}_[0-9]+.*/ unless release_name_shema # e.g. timestamps like 2014-04-11_1397227004
49
49
 
50
- publisher = Publisher::Ssh.new
50
+ publisher = ::Publisher::Ssh.new
51
51
  publisher.remote_host = options[:remote_host] || @cdb['remote_host']
52
52
  publisher.remote_user = options[:remote_user] || @cdb['remote_user']
53
53
  publisher.ssh_key_file = options[:ssh_key_file] || @cdb['ssh_key_file']
@@ -77,28 +77,28 @@ module Deployment
77
77
  end
78
78
 
79
79
  def git_fetch(options={})
80
- publisher = Publisher::Git.new
80
+ publisher = ::Publisher::Git.new
81
81
  publisher.repository_url = options[:git_repository_url] || @cdb['git_repository_url']
82
82
  publisher.repository_local_dir = options[:git_repository_local] || @cdb['git_repository_local']
83
83
  publisher.fetch()
84
84
  end
85
85
 
86
86
  def git_checkout(branch_name, options={})
87
- publisher = Publisher::Git.new
87
+ publisher = ::Publisher::Git.new
88
88
  publisher.repository_url = options[:git_repository_url] || @cdb['git_repository_url']
89
89
  publisher.repository_local_dir = options[:git_repository_local] || @cdb['git_repository_local']
90
90
  publisher.checkout(branch_name, options)
91
91
  end
92
92
 
93
93
  def git_submodule(submodule_option, options={})
94
- publisher = Publisher::Git.new
94
+ publisher = ::Publisher::Git.new
95
95
  publisher.repository_url = options[:git_repository_url] || @cdb['git_repository_url']
96
96
  publisher.repository_local_dir = options[:git_repository_local] || @cdb['git_repository_local']
97
97
  publisher.submodule(submodule_option, options)
98
98
  end
99
99
 
100
100
  def git_tag(tag_name, options={})
101
- publisher = Publisher::Git.new
101
+ publisher = ::Publisher::Git.new
102
102
  publisher.repository_url = options[:git_repository_url] || @cdb['git_repository_url']
103
103
  publisher.repository_local_dir = options[:git_repository_local] || @cdb['git_repository_local']
104
104
  publisher.tag(tag_name, options)
@@ -84,30 +84,16 @@ module Provider
84
84
  Helper.validates_presence_of path
85
85
 
86
86
  begin
87
- if true
88
- begin
89
- cdb_filesystem = Provider::CDB_FILESYSTEM.new
90
- result = JSON.parse(cdb_filesystem.read_data(path))
91
- #puts result
92
- rescue Exception => e
93
- $log.writer.error "Error: got invalid json from cdb"
94
- $log.writer.error "Request was: #{path.to_s}"
95
- $log.writer.error e.message
96
- exit 1
97
- end
98
- else
99
- url = protocol + '://' + \
100
- File.join(host, context, env, path, "showall.json")
101
87
 
102
- begin
103
- result = JSON.parse(Net::HTTP.get(URI.parse(url)))
104
- rescue Exception => e
105
- $log.writer.error "Error: got invalid json from cdb"
106
- $log.writer.error "Request was: #{url.to_s}"
107
- $log.writer.error "Answer was: #{Net::HTTP.get(URI.parse(url))}"
108
- $log.writer.error e.message
109
- exit 1
110
- end
88
+ begin
89
+ cdb_filesystem = Provider::CDB_FILESYSTEM.new
90
+ result = JSON.parse(cdb_filesystem.read_data(path))
91
+ #puts result
92
+ rescue Exception => e
93
+ $log.writer.error "Error: got invalid json from cdb"
94
+ $log.writer.error "Request was: #{path.to_s}"
95
+ $log.writer.error e.message
96
+ exit 1
111
97
  end
112
98
 
113
99
  # decrypt encrypted entries automagically
@@ -1,6 +1,6 @@
1
1
  module Provider
2
2
  class CDB_FILESYSTEM
3
-
3
+
4
4
  def load_yaml(filename)
5
5
  if File.file? filename
6
6
  begin
@@ -18,11 +18,9 @@ module Provider
18
18
  raise "File not found: #{filename}"
19
19
  end
20
20
  end
21
-
22
-
23
-
21
+
24
22
  def read_data(cdb_path, options={})
25
- config = Hash.new
23
+ config = Hash.new
26
24
  basedir = File.join(($recipe_config[:recipe_base_dir] || $recipe_config[:deploy_home]),'cdb')
27
25
  filename = ''
28
26
  if cdb_path.nil? or cdb_path.empty?
@@ -30,7 +28,7 @@ module Provider
30
28
  exit 1
31
29
  end
32
30
  paths = cdb_path.split('/')
33
-
31
+
34
32
  paths.each do |path|
35
33
  basedir = File.join( basedir, path.to_s )
36
34
  filename = basedir + '.yaml'
@@ -45,6 +43,6 @@ module Provider
45
43
  end
46
44
  config.to_json
47
45
  end
48
-
46
+
49
47
  end
50
- end
48
+ end
@@ -1,3 +1,3 @@
1
1
  module Depengine
2
- VERSION = "3.0.3"
2
+ VERSION = "3.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: depengine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Automatisierung