helmsnap 1.1.0 → 1.2.1

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: 306405fefdd0a806b1e89fd691a7412686218ffaeb981a9685e40ee6ff5a8880
4
+ data.tar.gz: 644a72cc622dcefe774bea2acc8cd9816f770290e4704b28aafa3b6311dae122
5
5
  SHA512:
6
- metadata.gz: cf1cdbdba197e96cb1ba2403bd69ee7d6cad705bcb2d6378f112852ba92477be6fb7dad954cafbca54fa88a4f93113a83b56d9c9aa33952d07710a128c5cca24
7
- data.tar.gz: 666bad3f4be9e21af24649a59508f88fc5f0a72bee4f26b32f10ed3f635224631d0cab4744e2c4260bb9c3fefa552f03f32f90eeb33c7c26f2324e4e84be9c7a
6
+ metadata.gz: d6c09ccb98572852ee4877afbe6c3371cb03e9a6df5476057770bee762e9f0a6f9eb3dab20e0c3d2de97c827ce1d4e2b1b524214f671ffe0c58c81fb1d40a00b
7
+ data.tar.gz: b0d4ba70df6544b282ba24b3dbefe8882f0a2cafe0634f60666ed8ca05209462e73303bc5a82fbb6edebb64fb8dbe3a7dfdc660df59b2566bdcc67dae670acb1
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.1)
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.cp_r(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.1"
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.1
5
5
  platform: ruby
6
+ original_platform: ''
6
7
  authors:
7
8
  - Yuri Smirnov
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
@@ -24,7 +24,6 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
- description:
28
27
  email:
29
28
  - tycooon@yandex.ru
30
29
  executables:
@@ -63,7 +62,6 @@ licenses:
63
62
  metadata:
64
63
  homepage_uri: https://github.com/tycooon/helmsnap
65
64
  source_code_uri: https://github.com/tycooon/helmsnap
66
- post_install_message:
67
65
  rdoc_options: []
68
66
  require_paths:
69
67
  - lib
@@ -78,8 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  - !ruby/object:Gem::Version
79
77
  version: '0'
80
78
  requirements: []
81
- rubygems_version: 3.5.21
82
- signing_key:
79
+ rubygems_version: 3.6.1
83
80
  specification_version: 4
84
81
  summary: A tool for creating and checking helm chart snapshots.
85
82
  test_files: []