minfra-cli 1.10.0 → 1.11.0

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
  SHA256:
3
- metadata.gz: 6b6ce82cdaae481dff04fd7af765c0afdf3dd8fbe2c58cb132d0e882bfa04333
4
- data.tar.gz: d11ca5d16a40cb3fab6a3d1b1a7b62169fdbebf4a8d089de926b569cc21aff33
3
+ metadata.gz: ba7dd8c8775a7ecedd048d2a6e6288727f86791bb0e3c9a97df882d29d10ddd1
4
+ data.tar.gz: 5a416953d916aff78611c5dcca45300434a54abb172aad5a5ad4118b9cb3206e
5
5
  SHA512:
6
- metadata.gz: c54299b3398f0b744aff1484c48836077704965cc3ba6d69bee3e3102df844232ac6d6bd6243b55cd2638a649fcffbc0997073788fc360c762c857f41f378d0b
7
- data.tar.gz: a13f08bc9f2efedcddb66ef5863ebe95c7892d3e4f801b9c0932b712828eb7022d640893acdf431d8662ac7b21a8aef6cccfde71dfcd239a2451e6159a07a950
6
+ metadata.gz: 1a0ab85e07b00c652cf41b94cff07cc327801d55f19eefe97a0d7301a2e0a8262196df760785fc6ef7ccd3d56e44deed3441260a868d4916266cb143b8c9d68e
7
+ data.tar.gz: 36a5f383251c4e6ae0f583f99e08606f07c1c6df198c721718d5dea1b2b9f1fab4629c7b99ee5950dd18a823148226b10bea2e558bfb5ce02c08ce800be3f7a5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.11.0
2
+ * generating helm output with resolved vairables in "helm_expanded"
3
+ * adding template_dir to templater to render whole directories
1
4
  # 1.10.0
2
5
  * project.json supports exec_params
3
6
  * helm values are all strings (so helm doesn't convert them)
@@ -21,6 +21,26 @@ module Minfra
21
21
  new(template).render(params)
22
22
  end
23
23
 
24
+ def self.template_dir(src, dst, extensions)
25
+ destination = Pathname.new(dst)
26
+ destination.mkpath
27
+ source = Pathname.new(src)
28
+
29
+ source.glob('**/*') do |filename|
30
+ rel_path = filename.relative_path_from(source)
31
+
32
+ if File.directory?(filename) # check if it s file and extension is not .tf
33
+ FileUtils.mkdir_p("#{destination}/#{rel_path}")
34
+ elsif extensions.include?(File.extname(filename)) # a file
35
+ content = File.read(filename)
36
+ modified_content = Minfra::Cli::Templater.render(content, {})
37
+ File.write("#{destination}/#{rel_path}", modified_content)
38
+ else
39
+ FileUtils.cp(filename, destination.join(rel_path))
40
+ end
41
+ end
42
+ end
43
+
24
44
  def initialize(template)
25
45
  @erb = ERB.new(template)
26
46
  @check_mode=false
@@ -1,5 +1,5 @@
1
1
  module Minfra
2
2
  module Cli
3
- VERSION = '1.10.0'.freeze
3
+ VERSION = '1.11.0'.freeze
4
4
  end
5
5
  end
@@ -163,7 +163,7 @@ module Orchparty
163
163
  def print_install(chart)
164
164
 
165
165
  build_chart(chart) do |chart_path|
166
- cmd="helm template --namespace #{namespace} --debug --kube-context #{cluster_name} #{chart.name} #{chart_path}"
166
+ cmd="helm template --namespace #{namespace} --debug --kube-context #{cluster_name} --output-dir #{chart_path.join('..','helm_expanded')} #{chart.name} #{chart_path}"
167
167
  @out_io.puts `$cmd`
168
168
  if system("#{cmd} > /dev/null")
169
169
  info("helm template check: OK")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfra-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Schrammel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-03 00:00:00.000000000 Z
11
+ date: 2023-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor