helmsnap 1.1.0 → 1.2.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: 6736a60925c46a19ac7d349ea1e0fff67d7d3e6499a74f9f620a00d17eda0f50
4
- data.tar.gz: 2441260a8c95cd7ae6c3b91616dce927cf7972652f8dc4431b0fc78379a93522
3
+ metadata.gz: 76c73dc7b61a3c405d200bb8af1d19e79ae7c25a150863f93d329e5735b4c83e
4
+ data.tar.gz: 0473a0a61ab7aa0b937a27d3d25b65f28443b21460f6f5ff3b16763d9fb7e62f
5
5
  SHA512:
6
- metadata.gz: cf1cdbdba197e96cb1ba2403bd69ee7d6cad705bcb2d6378f112852ba92477be6fb7dad954cafbca54fa88a4f93113a83b56d9c9aa33952d07710a128c5cca24
7
- data.tar.gz: 666bad3f4be9e21af24649a59508f88fc5f0a72bee4f26b32f10ed3f635224631d0cab4744e2c4260bb9c3fefa552f03f32f90eeb33c7c26f2324e4e84be9c7a
6
+ metadata.gz: 1a8ba0058f8830dd104c6cdafceb68b5e37cd6be0f5bcf1c0214ccb6f25b74c880531e049aabad500f8bd0e7e2e8b26d9e482ee7288fe8e43010a4d822b93b10
7
+ data.tar.gz: cffb46bf4a843124d62007b930e75fe753b12eda3ccdd312e1fb27a129d5b9dad7e09f1976c1a0436152fc4703362a48ffabeb286cf036e7ead275f0328bcc51
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- helmsnap (1.1.0)
4
+ helmsnap (1.2.0)
5
5
  colorize
6
6
 
7
7
  GEM
@@ -10,8 +10,17 @@ class Helmsnap::Generate < Helmsnap::Service
10
10
  def call
11
11
  Helmsnap::SetupDependencies.call(config)
12
12
 
13
- FileUtils.rmtree(snapshots_path)
13
+ Dir.mktmpdir do |tmpdir|
14
+ tmp_path = Pathname.new(tmpdir)
15
+ generate!(tmp_path)
16
+ end
17
+ end
18
+
19
+ private
20
+
21
+ attr_accessor :config, :snapshots_path
14
22
 
23
+ def generate!(tmp_path)
15
24
  config.envs.each do |env|
16
25
  run_cmd(
17
26
  "helmfile",
@@ -19,21 +28,20 @@ class Helmsnap::Generate < Helmsnap::Service
19
28
  env.name,
20
29
  "template",
21
30
  "--output-dir-template",
22
- snapshots_path.join(env.name).join("{{ .Release.Name }}"),
31
+ tmp_path.join(env.name, "{{ .Release.Name }}"),
23
32
  "--skip-deps",
24
33
  )
25
34
  end
26
35
 
27
- snapshots_path.glob(["**/*yaml", "**/*.yml"]).each do |path|
36
+ tmp_path.glob(["**/*yaml", "**/*.yml"]).each do |path|
28
37
  content = path.read
29
38
  content.gsub!(/\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d\.\d+/, "2022-01-01 00:00:00.000")
30
39
  content.gsub!(/\d\d\d\d-\d\d-\d\d-\d\d-\d\d-\d\d/, "2022-01-01-00-00-00")
31
40
  content.gsub!(/\d\d\d\d-\d\d-\d\d-\d\d-\d\d/, "2022-01-01-00-00")
32
41
  path.write(content)
33
42
  end
34
- end
35
-
36
- private
37
43
 
38
- attr_accessor :config, :snapshots_path
44
+ FileUtils.rmtree(snapshots_path)
45
+ FileUtils.move(tmp_path, snapshots_path)
46
+ end
39
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Helmsnap
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: helmsnap
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuri Smirnov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -78,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
78
  - !ruby/object:Gem::Version
79
79
  version: '0'
80
80
  requirements: []
81
- rubygems_version: 3.5.21
81
+ rubygems_version: 3.5.23
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: A tool for creating and checking helm chart snapshots.