minfra-cli 1.0.1 → 1.0.2

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: cab66f511ab6227678a724abe92791129b2a7fa892ce9c89f930b9c414cbc334
4
- data.tar.gz: 231d318901b435af0a09cbdc75cde85af803641a4592fe0f0262982dd91c1d41
3
+ metadata.gz: 5c2cd6c0f9b45301e739a4bd6498b506268d3ea4f668d9c5437d2f39c0e4cc30
4
+ data.tar.gz: 9d6dbf72959dcb9fa91787ddb2fb54610a3d8b1d6b023f09d5339e939e24e212
5
5
  SHA512:
6
- metadata.gz: 19c9601223257a4a38727f337a9ac279e04663175ecb8342a4dc0b96d229cf4f3aefe06bb4301d089fb640f21b774d6fb0c67cdf1cef951d3983534a80592d3c
7
- data.tar.gz: 40271ce6dda6d181362478070f1a38d7962e4ef8246dc13c8c10e84e3d99ebc352a0e9082f6cfab023ebb47208658cf2e2e94adfc6b853a6e74f4e1d8534d18f
6
+ metadata.gz: ca47a07f705b40f20a27372ce57c574db9e0dce1ef35a8c07b94858119bda680fe27201d8767ea482268ea856211e3bd3d8f0d1e58126e6feb4ced103d5da99a
7
+ data.tar.gz: 5085dce8b8d6cf68fd572dbba57a4587088d49c65a6dcd7669d5cdd4f43f71c15874022775be78e1808a91a25ed4b539d1ac55078e090aa4ecc2e302755ac208
data/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ # 1.0.2
2
+ * looking up cluster name by hiera cluster.id
1
3
  # 1.0.1
2
4
  * adding l! method
3
5
  # 1.0.0
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ccs-infra.gemspec
4
+ gemspec
5
+
6
+ gem "rake", "~> 12.0"
7
+ gem "rspec", "~> 3.0"
8
+ gem "timecop", "~> 0.9.5"
data/Gemfile.lock ADDED
@@ -0,0 +1,87 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minfra-cli (1.0.1)
5
+ activesupport (~> 6.1)
6
+ erubis (~> 2.7)
7
+ hashie (~> 3.5)
8
+ hiera (= 3.9.0)
9
+ hiera-eyaml (= 3.3.0)
10
+ hiera-eyaml-gpg (= 0.7.4)
11
+ rest-client (~> 2.0)
12
+ table_print (= 1.5.6)
13
+ thor (~> 1.0, >= 1.0.0)
14
+
15
+ GEM
16
+ remote: https://rubygems.org/
17
+ specs:
18
+ activesupport (6.1.7)
19
+ concurrent-ruby (~> 1.0, >= 1.0.2)
20
+ i18n (>= 1.6, < 2)
21
+ minitest (>= 5.1)
22
+ tzinfo (~> 2.0)
23
+ zeitwerk (~> 2.3)
24
+ concurrent-ruby (1.1.10)
25
+ diff-lcs (1.5.0)
26
+ domain_name (0.5.20190701)
27
+ unf (>= 0.0.5, < 1.0.0)
28
+ erubis (2.7.0)
29
+ hashie (3.6.0)
30
+ hiera (3.9.0)
31
+ hiera-eyaml (3.3.0)
32
+ highline
33
+ optimist
34
+ hiera-eyaml-gpg (0.7.4)
35
+ hiera-eyaml (>= 1.3.8)
36
+ highline (2.0.3)
37
+ http-accept (1.7.0)
38
+ http-cookie (1.0.5)
39
+ domain_name (~> 0.5)
40
+ i18n (1.12.0)
41
+ concurrent-ruby (~> 1.0)
42
+ mime-types (3.4.1)
43
+ mime-types-data (~> 3.2015)
44
+ mime-types-data (3.2022.0105)
45
+ minitest (5.16.3)
46
+ netrc (0.11.0)
47
+ optimist (3.0.1)
48
+ rake (12.3.3)
49
+ rest-client (2.1.0)
50
+ http-accept (>= 1.7.0, < 2.0)
51
+ http-cookie (>= 1.0.2, < 2.0)
52
+ mime-types (>= 1.16, < 4.0)
53
+ netrc (~> 0.8)
54
+ rspec (3.11.0)
55
+ rspec-core (~> 3.11.0)
56
+ rspec-expectations (~> 3.11.0)
57
+ rspec-mocks (~> 3.11.0)
58
+ rspec-core (3.11.0)
59
+ rspec-support (~> 3.11.0)
60
+ rspec-expectations (3.11.1)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.11.0)
63
+ rspec-mocks (3.11.1)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.11.0)
66
+ rspec-support (3.11.1)
67
+ table_print (1.5.6)
68
+ thor (1.2.1)
69
+ timecop (0.9.5)
70
+ tzinfo (2.0.5)
71
+ concurrent-ruby (~> 1.0)
72
+ unf (0.1.4)
73
+ unf_ext
74
+ unf_ext (0.0.8.2)
75
+ zeitwerk (2.6.0)
76
+
77
+ PLATFORMS
78
+ ruby
79
+
80
+ DEPENDENCIES
81
+ minfra-cli!
82
+ rake (~> 12.0)
83
+ rspec (~> 3.0)
84
+ timecop (~> 0.9.5)
85
+
86
+ BUNDLED WITH
87
+ 2.1.4
@@ -13,19 +13,12 @@ module Minfra
13
13
  @config = config
14
14
  @env = config.orch_env
15
15
  @deployment = deployment.freeze
16
- @cluster = cluster.freeze
16
+ @cluster = cluster.freeze || l!("cluster").id
17
17
  puts "Stack selection: #{@name}, #{@path}, #{@cluster}"
18
18
  end
19
19
 
20
20
  def cluster_name
21
- return @cluster_name if defined?(@cluster_name)
22
- @cluster_name = @cluster
23
- @cluster_name ||= "kind-#{@config.name}" if @config.dev?
24
- if cluster_path.exist? && (@cluster_name.nil? || @cluster_name.empty?)
25
- @cluster_name = YAML.load(File.read(cluster_path))[env.to_s]
26
- end
27
- @cluster_name ||= env
28
- @cluster_name
21
+ @cluster
29
22
  end
30
23
 
31
24
  def mixin_env
@@ -47,10 +40,6 @@ module Minfra
47
40
  release_path.join('stack.rb')
48
41
  end
49
42
 
50
- def cluster_path
51
- release_path.join("cluster.yaml")
52
- end
53
-
54
43
  def compose_path(blank: false)
55
44
  if blank
56
45
  release_path.join("compose.yaml")
@@ -65,15 +54,6 @@ module Minfra
65
54
  @errors.join(";\n")
66
55
  end
67
56
 
68
- # we use a special file to flag the this stack is releasable to an environment
69
- def releasable?
70
- switch_path.exist?
71
- end
72
-
73
- def switch_path
74
- release_path.join("#{@env}_#{rancher_stack_name}.sh")
75
- end
76
-
77
57
  def release_path
78
58
  @path
79
59
  end
@@ -1,5 +1,5 @@
1
1
  module Minfra
2
2
  module Cli
3
- VERSION = '1.0.1'.freeze
3
+ VERSION = '1.0.2'.freeze
4
4
  end
5
5
  end
data/lib/minfra/cli.rb CHANGED
@@ -75,7 +75,6 @@ module Minfra
75
75
  node_scope=hiera.lookup("env", {}, scope, nil, :deeper)
76
76
  scope=scope.merge(node_scope)
77
77
  cache={}
78
-
79
78
  Kernel.define_method(:l) do |value,default=nil|
80
79
  return cache[value] if cache.has_key?(value)
81
80
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minfra-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Schrammel
@@ -154,6 +154,8 @@ files:
154
154
  - ".gitignore"
155
155
  - CHANGELOG.md
156
156
  - Dockerfile
157
+ - Gemfile
158
+ - Gemfile.lock
157
159
  - bin/build
158
160
  - bin/console
159
161
  - bin/container_exec