helmsnap 1.2.2 → 1.3.1
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 +4 -4
- data/Dockerfile +1 -1
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/README.md +2 -0
- data/lib/helmsnap/args_parser.rb +16 -8
- data/lib/helmsnap/check.rb +4 -3
- data/lib/helmsnap/generate.rb +4 -3
- data/lib/helmsnap/runner.rb +3 -3
- data/lib/helmsnap/setup_dependencies.rb +4 -3
- data/lib/helmsnap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 16f1641c068bb4c5058cb5f3d90d8af556b5cc4f376af8514890a80178c30578
|
4
|
+
data.tar.gz: da571796408f1cf098e201a8a74f76db25a8b5ea5c652b4bcebe549572ab2165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 258ccb02ea856b85448615fe7c825ada52947bb9f7905a9a9e03825be8d53e799e47509e09aab25e4a0fcaa07dcc6b3621d4f38e809d382da7b1b7b1ce865fee
|
7
|
+
data.tar.gz: 196a08ad781ea3f7b77f0fcf85809f8b187e6a9d437b2587f2b52b369b19487f363b4afe92a7f17e264bc059620d7455b5eb3a3fa3d76827caa9928a1160d1dc
|
data/Dockerfile
CHANGED
@@ -4,7 +4,7 @@ RUN apk add --update --no-cache ruby git colordiff
|
|
4
4
|
|
5
5
|
WORKDIR /wd
|
6
6
|
|
7
|
-
COPY --from=ghcr.io/helmfile/helmfile /usr/local/bin/helmfile /usr/local/bin/helmfile
|
7
|
+
COPY --from=ghcr.io/helmfile/helmfile:v0.171.0 /usr/local/bin/helmfile /usr/local/bin/helmfile
|
8
8
|
COPY . .
|
9
9
|
|
10
10
|
RUN gem install colorize && gem build && gem install helmsnap --local
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
helmsnap (1.
|
4
|
+
helmsnap (1.3.1)
|
5
5
|
colorize
|
6
6
|
|
7
7
|
GEM
|
@@ -30,6 +30,7 @@ GEM
|
|
30
30
|
concurrent-ruby (~> 1.0)
|
31
31
|
json (2.7.2)
|
32
32
|
language_server-protocol (3.17.0.3)
|
33
|
+
logger (1.6.6)
|
33
34
|
method_source (1.1.0)
|
34
35
|
minitest (5.25.1)
|
35
36
|
mutex_m (0.2.0)
|
@@ -107,6 +108,7 @@ PLATFORMS
|
|
107
108
|
|
108
109
|
DEPENDENCIES
|
109
110
|
helmsnap!
|
111
|
+
logger
|
110
112
|
pry
|
111
113
|
rake
|
112
114
|
rspec
|
data/README.md
CHANGED
@@ -49,6 +49,8 @@ credentials: # [] by default
|
|
49
49
|
password: somepassword
|
50
50
|
```
|
51
51
|
|
52
|
+
Credentials will be matched by prefix, so if your repo URL is `https://example.com/some/path/to/repo`, you can also put values like `https://example.com/some/path` or `https://example.com` in `credentials.[].repo`.
|
53
|
+
|
52
54
|
You can also override configuration file location using `--config` option.
|
53
55
|
|
54
56
|
## Dependencies
|
data/lib/helmsnap/args_parser.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
class Helmsnap::ArgsParser
|
4
4
|
InvalidConfigPath = Class.new(RuntimeError)
|
5
5
|
|
6
|
-
Args = Struct.new(:config_path)
|
6
|
+
Args = Struct.new(:config_path, :skip_repo_cleanup)
|
7
7
|
|
8
8
|
DEFAULT_CONFIG_PATH = Pathname.new(".helmsnap.yaml")
|
9
9
|
CONFIG_PATH_HELP = %{Path to config (default: "#{DEFAULT_CONFIG_PATH}")}.freeze
|
@@ -38,14 +38,12 @@ class Helmsnap::ArgsParser
|
|
38
38
|
opts.separator("")
|
39
39
|
opts.separator("Specific options:")
|
40
40
|
|
41
|
-
opts.on("-c", "--config CONFIG_PATH", CONFIG_PATH_HELP) do |
|
42
|
-
|
43
|
-
|
44
|
-
unless path.file? && path.readable?
|
45
|
-
raise InvalidConfigPath, "Not a readable file: #{val}"
|
46
|
-
end
|
41
|
+
opts.on("-c", "--config CONFIG_PATH", CONFIG_PATH_HELP) do |value|
|
42
|
+
set_config!(value)
|
43
|
+
end
|
47
44
|
|
48
|
-
|
45
|
+
opts.on("--skip-repo-cleanup", "Skip cleaning up existing helmsnap-related helm repos") do
|
46
|
+
args.skip_repo_cleanup = true
|
49
47
|
end
|
50
48
|
|
51
49
|
opts.on("-v", "--version", "Show version") do
|
@@ -59,4 +57,14 @@ class Helmsnap::ArgsParser
|
|
59
57
|
end
|
60
58
|
end
|
61
59
|
end
|
60
|
+
|
61
|
+
def set_config!(value)
|
62
|
+
path = Pathname.new(value)
|
63
|
+
|
64
|
+
unless path.file? && path.readable?
|
65
|
+
raise InvalidConfigPath, "Not a readable file: #{value}"
|
66
|
+
end
|
67
|
+
|
68
|
+
args.config_path = path
|
69
|
+
end
|
62
70
|
end
|
data/lib/helmsnap/check.rb
CHANGED
@@ -1,15 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Helmsnap::Check < Helmsnap::Service
|
4
|
-
def initialize(config)
|
4
|
+
def initialize(config, options)
|
5
5
|
super()
|
6
6
|
self.config = config
|
7
|
+
self.options = options
|
7
8
|
end
|
8
9
|
|
9
10
|
def call
|
10
11
|
temp_dir_path = Pathname.new(Dir.mktmpdir)
|
11
12
|
|
12
|
-
Helmsnap::Generate.call(config, snapshots_path: temp_dir_path)
|
13
|
+
Helmsnap::Generate.call(config, options, snapshots_path: temp_dir_path)
|
13
14
|
|
14
15
|
result = run_cmd("which", "colordiff", allow_failure: true)
|
15
16
|
util = result.success ? "colordiff" : "diff"
|
@@ -24,5 +25,5 @@ class Helmsnap::Check < Helmsnap::Service
|
|
24
25
|
|
25
26
|
private
|
26
27
|
|
27
|
-
attr_accessor :config
|
28
|
+
attr_accessor :config, :options
|
28
29
|
end
|
data/lib/helmsnap/generate.rb
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Helmsnap::Generate < Helmsnap::Service
|
4
|
-
def initialize(config, snapshots_path: nil)
|
4
|
+
def initialize(config, options, snapshots_path: nil)
|
5
5
|
super()
|
6
6
|
self.config = config
|
7
|
+
self.options = options
|
7
8
|
self.snapshots_path = snapshots_path || config.snapshots_path
|
8
9
|
end
|
9
10
|
|
10
11
|
def call
|
11
|
-
Helmsnap::SetupDependencies.call(config)
|
12
|
+
Helmsnap::SetupDependencies.call(config, options)
|
12
13
|
|
13
14
|
Dir.mktmpdir do |tmpdir|
|
14
15
|
tmp_path = Pathname.new(tmpdir)
|
@@ -18,7 +19,7 @@ class Helmsnap::Generate < Helmsnap::Service
|
|
18
19
|
|
19
20
|
private
|
20
21
|
|
21
|
-
attr_accessor :config, :snapshots_path
|
22
|
+
attr_accessor :config, :options, :snapshots_path
|
22
23
|
|
23
24
|
def generate!(tmp_path)
|
24
25
|
config.envs.each do |env|
|
data/lib/helmsnap/runner.rb
CHANGED
@@ -38,12 +38,12 @@ class Helmsnap::Runner < Helmsnap::Service
|
|
38
38
|
attr_accessor :args, :options, :config
|
39
39
|
|
40
40
|
def generate!
|
41
|
-
Helmsnap::Generate.call(config)
|
41
|
+
Helmsnap::Generate.call(config, options)
|
42
42
|
Helmsnap::Console.info($stdout, "Snapshots generated successfully.")
|
43
43
|
end
|
44
44
|
|
45
45
|
def check!
|
46
|
-
if Helmsnap::Check.call(config)
|
46
|
+
if Helmsnap::Check.call(config, options)
|
47
47
|
Helmsnap::Console.info($stdout, "Snapshots are up-to-date.")
|
48
48
|
else
|
49
49
|
example_cmd = Shellwords.join(["helmsnap", "generate", "--config", options.config_path])
|
@@ -62,6 +62,6 @@ class Helmsnap::Runner < Helmsnap::Service
|
|
62
62
|
end
|
63
63
|
|
64
64
|
def setup_deps!
|
65
|
-
Helmsnap::SetupDependencies.call(config)
|
65
|
+
Helmsnap::SetupDependencies.call(config, options)
|
66
66
|
end
|
67
67
|
end
|
@@ -3,14 +3,15 @@
|
|
3
3
|
class Helmsnap::SetupDependencies < Helmsnap::Service
|
4
4
|
REPO_NAME_PREFIX = "helmsnap-"
|
5
5
|
|
6
|
-
def initialize(config)
|
6
|
+
def initialize(config, options)
|
7
7
|
super()
|
8
8
|
self.config = config
|
9
|
+
self.options = options
|
9
10
|
self.processed_paths = Set.new
|
10
11
|
end
|
11
12
|
|
12
13
|
def call
|
13
|
-
clear_existing_repos!
|
14
|
+
clear_existing_repos! unless options.skip_repo_cleanup
|
14
15
|
|
15
16
|
config.envs.flat_map(&:release_paths).each do |chart_path|
|
16
17
|
setup!(chart_path)
|
@@ -19,7 +20,7 @@ class Helmsnap::SetupDependencies < Helmsnap::Service
|
|
19
20
|
|
20
21
|
private
|
21
22
|
|
22
|
-
attr_accessor :config, :processed_paths
|
23
|
+
attr_accessor :config, :options, :processed_paths
|
23
24
|
|
24
25
|
def clear_existing_repos!
|
25
26
|
result = run_cmd("helm", "repo", "ls", allow_failure: true).output
|
data/lib/helmsnap/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: helmsnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuri Smirnov
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date:
|
10
|
+
date: 2025-03-20 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: colorize
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
|
-
rubygems_version: 3.6.
|
78
|
+
rubygems_version: 3.6.6
|
79
79
|
specification_version: 4
|
80
80
|
summary: A tool for creating and checking helm chart snapshots.
|
81
81
|
test_files: []
|