minfra-cli 1.8.0 → 1.10.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 852b56a96bf9ed6edf769a5ab0f3543a41d0759d81c1bf99b4ecd488ed0467a4
4
- data.tar.gz: badd1560a02911fa7a1b15de36eb6ae59abb584f29824247948899ae33ec11a2
3
+ metadata.gz: 6b6ce82cdaae481dff04fd7af765c0afdf3dd8fbe2c58cb132d0e882bfa04333
4
+ data.tar.gz: d11ca5d16a40cb3fab6a3d1b1a7b62169fdbebf4a8d089de926b569cc21aff33
5
5
  SHA512:
6
- metadata.gz: d57dfbd9ac19d4a982ab32f418100ab9f8cdde0419ba20a59a34f0d519a1d9b7ca6f6dfcbb5a4203d659fc3e3ced737454f115668aac796dc44041a9f4062dc3
7
- data.tar.gz: 2190a697f7044c2ee18ee722b2ab1a6497d5f90506d084145644e927404328203e8dd80481419a308e597ecc65d041e844d969aff41403baf4a1836b4d187f56
6
+ metadata.gz: c54299b3398f0b744aff1484c48836077704965cc3ba6d69bee3e3102df844232ac6d6bd6243b55cd2638a649fcffbc0997073788fc360c762c857f41f378d0b
7
+ data.tar.gz: a13f08bc9f2efedcddb66ef5863ebe95c7892d3e4f801b9c0932b712828eb7022d640893acdf431d8662ac7b21a8aef6cccfde71dfcd239a2451e6159a07a950
data/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ # 1.10.0
2
+ * project.json supports exec_params
3
+ * helm values are all strings (so helm doesn't convert them)
4
+ # 1.9.0
5
+ * helm template now called with --debug
6
+ * added "file" to service
7
+ * ready for ruby 3.2
8
+ * fixing project build "loading int " typo
9
+ * changing init sequence (first load minfrarc)
10
+ * STDERR of external commands is now written as INFO
11
+
1
12
  # 1.8.0
2
13
  * more output which "require" failed when loading dependencies
3
14
  * catching closed stream errors in Minfra::Cli::Runner
@@ -40,7 +40,7 @@ module Minfra
40
40
  ARGV.delete('project') # ARGV is passed along to `rspec` call
41
41
  ARGV.delete('test')
42
42
 
43
- if File.exists?('./bin/run_tests')
43
+ if File.exist?('./bin/run_tests')
44
44
  # config = Config.load('staging')
45
45
  project = ProjectInfo.load(Pathname.pwd)
46
46
  # Minfra::Cli::Document.document(config, "Using project specific ./bin/run_tests in #{project.name}")
@@ -68,7 +68,7 @@ module Minfra
68
68
  exit(1) if res.error?
69
69
 
70
70
  unless options[:noload]
71
- debug("loading int KIND")
71
+ debug("loading image into KIND's registry")
72
72
  Runner.run(%{kind load docker-image #{p.repo_name}:latest --name #{minfra_config.name}})
73
73
  end
74
74
  end
@@ -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"
@@ -24,7 +24,7 @@ module Minfra
24
24
  debug line
25
25
  else
26
26
  @stderr_lines << line
27
- error line
27
+ info line
28
28
  end
29
29
  end
30
30
 
@@ -1,5 +1,5 @@
1
1
  module Minfra
2
2
  module Cli
3
- VERSION = '1.8.0'.freeze
3
+ VERSION = '1.10.0'.freeze
4
4
  end
5
5
  end
data/lib/minfra/cli.rb CHANGED
@@ -47,6 +47,12 @@ module Minfra
47
47
 
48
48
  @logger=Logger.new(STDERR)
49
49
  logger.level=ENV["MINFRA_LOGGING_LEVEL"] || @config.project.minfra.logging_level || 'warn'
50
+
51
+ project_minfrarc_path = @config.base_path.join("config",'minfrarc.rb')
52
+ require project_minfrarc_path if project_minfrarc_path.exist?
53
+ me_minfrarc_path = @config.me_path.join('minfrarc.rb')
54
+ require @me_minfrarc_path if me_minfrarc_path.exist?
55
+
50
56
  @logger.debug("Minfra: loglevel: #{@logger.level}, env: #{@config.orch_env}")
51
57
 
52
58
  hiera_init
@@ -58,10 +64,7 @@ module Minfra
58
64
  require_relative 'cli/main_command'
59
65
  Minfra::Cli.resolve
60
66
 
61
- project_minfrarc_path = @config.base_path.join("config",'minfrarc.rb')
62
- require project_minfrarc_path if project_minfrarc_path.exist?
63
- me_minfrarc_path = @config.me_path.join('minfrarc.rb')
64
- require @me_minfrarc_path if me_minfrarc_path.exist?
67
+
65
68
 
66
69
  end
67
70
 
@@ -331,6 +331,7 @@ module Orchparty
331
331
 
332
332
  def initialize(name, type)
333
333
  super AST.service(name: name, _type: type)
334
+ @node.files = {}
334
335
  end
335
336
 
336
337
  # 1. rememebring the secrets in environment_secrets (so these environments can be created differentyly
@@ -340,6 +341,18 @@ module Orchparty
340
341
  @node.environment_secrets = result
341
342
  self
342
343
  end
344
+
345
+ def file(name, volume, &block)
346
+ result = FileBuilder.build(name, volume, block)
347
+ @node.files[name]=result
348
+ self
349
+ end
350
+ end
351
+
352
+ class FileBuilder < CommonBuilder
353
+ def initialize(name, volume)
354
+ super AST.service(filename: name, volume: volume)
355
+ end
343
356
  end
344
357
 
345
358
  class ServiceMixinBuilder < CommonBuilder
@@ -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} --kube-context #{cluster_name} #{chart.name} #{chart_path}"
166
+ cmd="helm template --namespace #{namespace} --debug --kube-context #{cluster_name} #{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.8.0
4
+ version: 1.10.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-02-23 00:00:00.000000000 Z
11
+ date: 2023-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
239
  requirements: []
240
- rubygems_version: 3.1.6
240
+ rubygems_version: 3.4.6
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: A cli framework for k8s based development and deployment.