minfra-cli 4.3.0 → 4.4.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: 3130c38b75f95a1e33c187d6b2026ef0eead6ae92855021ef8c52a3d47aefc28
4
- data.tar.gz: fe0fbbfee11d712ae34668bd9c5f87696fbf7c08186b409f0e33baf1d24ec449
3
+ metadata.gz: 06e100d0667dba3e52f6e1f38633a72d47e3ec18ba8f0fb679abf871eabcef50
4
+ data.tar.gz: da63967be82772cdfe504a59dabc25f38a72ad061ca669e9b695e0c44b5b6629
5
5
  SHA512:
6
- metadata.gz: 5b52d83585031a954c4db6a632322ecb3077936bed7ffa824d125e5ca6fb6341aead5abf1220671e9e17fcd6c7c0f541ea2a39405d541b51b5c1db11d9c8ffd1
7
- data.tar.gz: 46aaa7a2acfe06a6fc190a21e5c7e0c391a55d503eda59618961b77f334203a1efa47d6c0ea337bdccbf2c22d255021ca1f148e9a23ae9f1863e543fa1748e27
6
+ metadata.gz: 95b34f5effb48354fd5eb02a93317a0cb31d849841c842875d3d58e8575316a7e90b399252e0eb6cc83b71529ecf0f81ec719657ba3ef1fc15c54bd3b9ce49b2
7
+ data.tar.gz: 0a8cf48b7e6148eb1713383d3ec2292de0436b01e5278fc3a2bd650eedfc01b0c130d8fd3ab33ab46dcdc7ceb4289d32e431f49a830b1819f4197d3063a745e9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 4.4.0
2
+ * adding test option to runner to not run any command
3
+ * adding option tag to project branch create to fully override tag generation logic
4
+ * adding test options to project branch create to not run the final git command
5
+ # 4.3.1
6
+ * hashie mash hashes for helm values are now type converted correctl
1
7
  # 4.3.0
2
8
  * raising EnvNotFound when the environment is not found
3
9
  * instead of patching yaml we're introducing yeaml backend to lookup eyaml files without decryption
@@ -7,15 +7,27 @@ module Minfra
7
7
  desc "create 'story desc'", 'create branch'
8
8
  option :prefix, type: :string,
9
9
  desc: "don't use your git email address or project.branch.create.prefix or identity.email"
10
+ option :tag, type: :string, desc: 'overwrite default tag generation'
11
+ option :test, type: :boolean, default: false, desc: "don't create the tag just show the command"
12
+
10
13
  def create(story_desc)
11
- story_desc = story_desc.gsub(/[^0-9a-z-]/i, '_')
12
- prefix = options[:prefix] || Minfra::Cli.config.project.dig('project', 'branch', 'create', 'prefix')
13
- unless prefix
14
- email = Minfra::Cli.config.project.dig('identity', 'email') || `git config user.email`
15
- fullname = email.split('@').first
16
- prefix = fullname[0] + fullname.split('.').last
14
+ if options[:tag]
15
+ tag = options[:tag]
16
+ else
17
+ story_desc = story_desc.gsub(/[^0-9a-z-]/i, '_')
18
+
19
+ prefix = options[:prefix] || Minfra::Cli.config.project.dig('project', 'branch', 'create', 'prefix')
20
+ unless prefix
21
+ email = Minfra::Cli.config.project.dig('identity', 'email') || `git config user.email`
22
+ fullname = email.split('@').first
23
+ prefix = fullname[0] + fullname.split('.').last
24
+ end
25
+
26
+ now = Time.now.utc.strftime('%Y%m%d')
27
+ tag = options[:tag] || "#{prefix}_#{story_desc}_#{now}"
17
28
  end
18
- Runner.run("git checkout -b #{prefix}_#{story_desc}_$(date +%Y%m%d)")
29
+
30
+ Runner.run("git checkout -b #{tag}", test: options[:test])
19
31
  end
20
32
  end
21
33
  end
@@ -64,16 +64,18 @@ module Minfra
64
64
 
65
65
  attr_reader :exit_on_error, :runner, :cmd, :on_output
66
66
 
67
- def initialize(cmd, exit_on_error: true, runner: :popen, on_output: nil)
67
+ def initialize(cmd, exit_on_error: true, runner: :popen, on_output: nil, test: false)
68
68
  @cmd = cmd
69
69
  @exit_on_error = exit_on_error
70
70
  @runner = runner
71
71
  @on_output = on_output
72
+ @test = test
72
73
  end
73
74
 
74
75
  def run
75
76
  debug("running (#{@runner}): #{@cmd}")
76
77
  res = Result.new(on_output:)
78
+ return res if @test
77
79
  case @runner
78
80
  when :system
79
81
  run_system(res)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Minfra
4
4
  module Cli
5
- VERSION = '4.3.0'
5
+ VERSION = '4.4.0'
6
6
  end
7
7
  end
@@ -257,6 +257,8 @@ module Orchparty
257
257
  { variable => value.to_s}.to_yaml[4..-1]
258
258
  when yml.match(/!ruby\/array:Hashie::Array/)
259
259
  { variable => value.to_a}.to_yaml[4..-1]
260
+ when yml.match(/!ruby\/hash:Hashie::Mash/)
261
+ { variable => value.to_h}.to_yaml[4..-1]
260
262
  else
261
263
  yml
262
264
  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: 4.3.0
4
+ version: 4.4.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: 2024-05-15 00:00:00.000000000 Z
11
+ date: 2024-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor