canzea 0.1.131 → 0.1.132
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/canzea/version.rb +1 -1
- data/lib/canzea.rb +10 -1
- data/lib/commands/config-git-commit.rb +15 -3
- 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: 3a22dc3a0156ff7036ca85003dc3948838a64dae
|
4
|
+
data.tar.gz: 0f2e1d504adfdb428adfef91b54032543f7e1fa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d991a2022df498c02d3c3233d44560fceb6dc6244b62a5c1c7d423fe83123cf6bbd91cc939b12594a691113bddc8f625e6e1f485557b1bc269d23d5683fd016
|
7
|
+
data.tar.gz: 80aa98e5ec8bbcb199dce40d7c02dbf55b50b9a1704755f2311b5b64032c570e40f31e106827153dbb8aea63bcef0ff9870a5af9189a3ceab31690edd9cc00ab
|
data/lib/canzea/version.rb
CHANGED
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}
|
22
|
+
dest = "#{gitRoot}/#{basePath}#{Pathname.new(sourcePath).realpath}"
|
16
23
|
else
|
17
|
-
dest = "#{gitRoot}
|
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.
|
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-
|
11
|
+
date: 2017-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|