minfra-cli 1.9.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: f850f6ee46b5749af756bfb223e38836a3bc538dc8bcbe4b1f2fb3bc2c3a131a
4
- data.tar.gz: e5b4b5b317c1ead81fedae5d78021003c31a55858fe36e040fad59c61d8e8c23
3
+ metadata.gz: ba7dd8c8775a7ecedd048d2a6e6288727f86791bb0e3c9a97df882d29d10ddd1
4
+ data.tar.gz: 5a416953d916aff78611c5dcca45300434a54abb172aad5a5ad4118b9cb3206e
5
5
  SHA512:
6
- metadata.gz: 26036eb5236bedf5a6cf6f3a39b8ceb272d8242938bf1730c20b0385facb0c1c9c1c8c92335c670562b5bd3dc946eae7e5891963b38643e0144f2b5ed5b8d3d3
7
- data.tar.gz: 47cba9834d267496e5411d9d326a3a5d8899cb8a06119bbcafa790fdef48fd22ee620eea43725b706627efc59bdfb0db03fa93a0950de5f913476a81a46054eb
6
+ metadata.gz: 1a0ab85e07b00c652cf41b94cff07cc327801d55f19eefe97a0d7301a2e0a8262196df760785fc6ef7ccd3d56e44deed3441260a868d4916266cb143b8c9d68e
7
+ data.tar.gz: 36a5f383251c4e6ae0f583f99e08606f07c1c6df198c721718d5dea1b2b9f1fab4629c7b99ee5950dd18a823148226b10bea2e558bfb5ce02c08ce800be3f7a5
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 1.11.0
2
+ * generating helm output with resolved vairables in "helm_expanded"
3
+ * adding template_dir to templater to render whole directories
4
+ # 1.10.0
5
+ * project.json supports exec_params
6
+ * helm values are all strings (so helm doesn't convert them)
1
7
  # 1.9.0
2
8
  * helm template now called with --debug
3
9
  * added "file" to service
@@ -77,7 +77,7 @@ module Minfra
77
77
  def exec(cmd='/bin/bash')
78
78
  p=ProjectInfo.load(Pathname.pwd)
79
79
  run_pre_repo
80
- Kernel.exec(%{docker run -ti --rm -v #{p.app_dir}:/code #{p.repo_name}:latest #{cmd}})
80
+ Kernel.exec(%{docker run -ti --rm #{p.exec_params} -v #{p.app_dir}:/code #{p.repo_name}:latest #{cmd}})
81
81
  end
82
82
 
83
83
  desc "push", "push directly to the repo"
@@ -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.9.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")
@@ -222,7 +222,7 @@ module Orchparty
222
222
  output_chart_path: output_chart_path
223
223
  )
224
224
  used_vars.each do |variable,value|
225
- helm_values.puts "#{variable}: #{value}"
225
+ helm_values.puts "#{variable}: \"#{value}\""
226
226
  end
227
227
  end
228
228
  end
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.9.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-03-22 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