canzea 0.1.131 → 0.1.132

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: a965e71ff131905ac4d64d348e4d317096772985
4
- data.tar.gz: a1ec3c6b626c3ce5d891bafa4891e89155cb72d1
3
+ metadata.gz: 3a22dc3a0156ff7036ca85003dc3948838a64dae
4
+ data.tar.gz: 0f2e1d504adfdb428adfef91b54032543f7e1fa5
5
5
  SHA512:
6
- metadata.gz: 73c83cf4d14eb47284aef03ee2dc43af128be0371c82b1090cca94523e63e9e19c36b8a66fce23ef6ba7f74aa9c2b8b05a0abbf459e9b364669a65db8b4a4936
7
- data.tar.gz: 4b7b5b0315c7b9e09598c3b479fd3f32015c6803dfc446299e07d113a6c3322c067daf2bd63d03fa4c984a9e0f9bc320295df7c5e3e745743566b7dd01c6fd4f
6
+ metadata.gz: 4d991a2022df498c02d3c3233d44560fceb6dc6244b62a5c1c7d423fe83123cf6bbd91cc939b12594a691113bddc8f625e6e1f485557b1bc269d23d5683fd016
7
+ data.tar.gz: 80aa98e5ec8bbcb199dce40d7c02dbf55b50b9a1704755f2311b5b64032c570e40f31e106827153dbb8aea63bcef0ff9870a5af9189a3ceab31690edd9cc00ab
@@ -1,3 +1,3 @@
1
1
  module Canzea
2
- VERSION = "0.1.131"
2
+ VERSION = "0.1.132"
3
3
  end
data/lib/canzea.rb CHANGED
@@ -64,6 +64,7 @@ module Canzea
64
64
  option nil, :util, "Utility action [gen-user, gen-cert, add-env, add-env-secret, prepare-plan, apply-config]", argument: :required
65
65
  option nil, :catalogTag, 'Specific tag of the catalog', argument: :required
66
66
  option nil, :gitRoot, 'Git root', argument: :required
67
+ option nil, :gitUri, 'Git URI', argument: :required
67
68
 
68
69
  option nil, :commit, 'Commit', argument: :required
69
70
  option nil, :role, 'Role', argument: :required
@@ -243,9 +244,17 @@ module Canzea
243
244
  end
244
245
 
245
246
  if opts[:config_git_commit]
247
+ if (ENV.has_key?('ECOSYSTEM') == false)
248
+ raise "ECOSYSTEM environment variable must be set for this command"
249
+ end
250
+
246
251
  gitRoot = opts.fetch(:gitRoot, Canzea::config[:git_repo])
252
+ gitUri = opts.fetch(:gitUri);
253
+
254
+ basePath = "ecosystems/#{ENV['ECOSYSTEM']}/config/#{opts[:serverBase]}-#{opts[:serverNumber]}"
255
+
247
256
  cg = ConfigGitCommit.new
248
- cg.do gitRoot, args[0], opts[:template], (args.length == 1 ? {}:JSON.parse(args[1]))
257
+ cg.do gitRoot, gitUri, args[0], opts[:template], basePath, (args.length == 1 ? {}:JSON.parse(args[1]))
249
258
  end
250
259
  end
251
260
  end
@@ -7,14 +7,21 @@ class ConfigGitCommit
7
7
  @log = Logger.new(Canzea::config[:logging_root] + '/plans.log')
8
8
  end
9
9
 
10
- def do(gitRoot, sourcePath, template, parameters)
10
+ def do(gitRoot, gitUri, sourcePath, template, basePath, parameters)
11
11
  begin
12
+ log "Using basePath #{basePath}"
13
+
14
+ if (File.exists?(gitRoot) == false)
15
+ log "Cloning git repository #{gitUri}"
16
+ g = Git.clone(gitUri, "", :path => gitRoot)
17
+ end
18
+
12
19
  # if file exists on file system and does not exist in gitRoot, then commit the "oem" file
13
20
 
14
21
  if (File.exists?(sourcePath))
15
- dest = "#{gitRoot}/config#{Pathname.new(sourcePath).realpath}"
22
+ dest = "#{gitRoot}/#{basePath}#{Pathname.new(sourcePath).realpath}"
16
23
  else
17
- dest = "#{gitRoot}/config#{sourcePath}"
24
+ dest = "#{gitRoot}/#{basePath}#{sourcePath}"
18
25
  end
19
26
  log "Writing to #{dest}"
20
27
 
@@ -47,6 +54,11 @@ class ConfigGitCommit
47
54
  g.commit("Config update #{sourcePath}")
48
55
  end
49
56
  end
57
+
58
+ if (Canzea::config[:track_changes_in_git])
59
+ g = Git.init(gitRoot)
60
+ g.push
61
+ end
50
62
  rescue => exception
51
63
  @log.error("ConfigGitCommit Failed")
52
64
  @log.error(exception.to_s)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: canzea
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.131
4
+ version: 0.1.132
5
5
  platform: ruby
6
6
  authors:
7
7
  - Canzea Technologies
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-15 00:00:00.000000000 Z
11
+ date: 2017-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler