kubernetes_template_rendering 0.1.0.pre.1 → 0.1.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: bd6a61ce9b0278d451c6e402ffab894a703846d04704061be05b1bdd30ddfef1
4
- data.tar.gz: '079c1784c5357f79fa1e6d6e5a15ef00ea6f2bdf72f37b1ff3949283d3d328ef'
3
+ metadata.gz: 5b05563ef123216e666bf9be24a72f445455386367b500a64d202468e5ab3292
4
+ data.tar.gz: e923ed36b4fdf9267ddb45860425895186c1289582cfb179bc136fb98758432d
5
5
  SHA512:
6
- metadata.gz: 2eee87d74893f113a7b999c312457001cc5a8df0fed38b3827b7e773b5f243f2f73625b69ceb7e330576a4438671aa7f7c6491bf80b1b3e82b2167ab31d272ed
7
- data.tar.gz: 17698c156cc055c8d0e42c1194f88d1ba99b1152712c2ee212393222ac5a93c75ca1029f424cf01f86993f95113fec39183546f4aef04a3d46f3f02de8e6190c
6
+ metadata.gz: 5ffe4df38a962360ca6f1d84ee122182e0abd3c3d220b6577e576fe3237e0cf12736b7fbb03a814e7d10870af3df36761913074b2cb428ebdf940eac64f4eaa1
7
+ data.tar.gz: 6e6d5b003e44d68c59834bf25f2d0a67be7041f964030b221d2845f3bd7a50c2ef8b0fccc7b3e99f5ea63420572970f0a7679d6c99d3b28141417bad3e81de4f
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem you can either install it, and use the `render_kubernetes_templa
24
24
 
25
25
  ### Example Usage
26
26
  ```bash
27
- gem exec -g kubernetes_template_rendering render_kubernetes_templates \
27
+ gem exec -g kubernetes_template_rendering render_templates \
28
28
  --jsonnet-library-path deployment/vendor \
29
29
  --rendered_directory path/to/resources \
30
30
  deployment/templates
@@ -34,7 +34,7 @@ gem exec -g kubernetes_template_rendering render_kubernetes_templates \
34
34
 
35
35
  To see a full list of options and how to use them, run the following command:
36
36
  ```bash
37
- gem exec -g kubernetes_template_rendering render_kubernetes_templates --help
37
+ gem exec -g kubernetes_template_rendering render_templates --help
38
38
  ```
39
39
 
40
40
  ## Development
data/catalog-info.yaml ADDED
@@ -0,0 +1,19 @@
1
+ apiVersion: backstage.io/v1alpha1
2
+ kind: Component
3
+ metadata:
4
+ name: kubernetes_template_rendering
5
+ title: Kubernetes Template Rendering gem
6
+ description: |
7
+ A Ruby gem that provides a way to render Kubernetes templates using ERB and Jsonnet.
8
+ annotations:
9
+ github.com/project-slug: invoca/kubernetes_template_rendering
10
+ backstage.io/adr-location: >-
11
+ https://github.com/Invoca/kubernetes_template_rendering/tree/main/docs/adrs
12
+ backstage.io/techdocs-ref: dir:.
13
+ buildkite.com/project-slug: invoca/kubernetes-template-rendering
14
+ invoca.com/version-repository-location: rubygems
15
+ invoca.com/version-repository-name: kubernetes_template_rendering
16
+ spec:
17
+ type: Library
18
+ lifecycle: production
19
+ owner: octothorpe
data/docs/CHANGELOG.md ADDED
@@ -0,0 +1 @@
1
+ ../CHANGELOG.md
data/docs/README.md ADDED
@@ -0,0 +1 @@
1
+ ../README.md
@@ -0,0 +1,72 @@
1
+ # [short title of solved problem and solution]
2
+
3
+ * Status: [proposed | rejected | accepted | deprecated | … | superseded by [ADR-0005](0005-example.md)] <!-- optional -->
4
+ * Deciders: [list everyone involved in the decision] <!-- optional -->
5
+ * Date: [YYYY-MM-DD when the decision was last updated] <!-- optional -->
6
+
7
+ Technical Story: [description | ticket/issue URL] <!-- optional -->
8
+
9
+ ## Context and Problem Statement
10
+
11
+ [Describe the context and problem statement, e.g., in free form using two to three sentences. You may want to articulate the problem in form of a question.]
12
+
13
+ ## Decision Drivers <!-- optional -->
14
+
15
+ * [driver 1, e.g., a force, facing concern, …]
16
+ * [driver 2, e.g., a force, facing concern, …]
17
+ * … <!-- numbers of drivers can vary -->
18
+
19
+ ## Considered Options
20
+
21
+ * [option 1]
22
+ * [option 2]
23
+ * [option 3]
24
+ * … <!-- numbers of options can vary -->
25
+
26
+ ## Decision Outcome
27
+
28
+ Chosen option: "[option 1]", because [justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force force | … | comes out best (see below)].
29
+
30
+ ### Positive Consequences <!-- optional -->
31
+
32
+ * [e.g., improvement of quality attribute satisfaction, follow-up decisions required, …]
33
+ * …
34
+
35
+ ### Negative Consequences <!-- optional -->
36
+
37
+ * [e.g., compromising quality attribute, follow-up decisions required, …]
38
+ * …
39
+
40
+ ## Pros and Cons of the Options <!-- optional -->
41
+
42
+ ### [option 1]
43
+
44
+ [example | description | pointer to more information | …] <!-- optional -->
45
+
46
+ * Good, because [argument a]
47
+ * Good, because [argument b]
48
+ * Bad, because [argument c]
49
+ * … <!-- numbers of pros and cons can vary -->
50
+
51
+ ### [option 2]
52
+
53
+ [example | description | pointer to more information | …] <!-- optional -->
54
+
55
+ * Good, because [argument a]
56
+ * Good, because [argument b]
57
+ * Bad, because [argument c]
58
+ * … <!-- numbers of pros and cons can vary -->
59
+
60
+ ### [option 3]
61
+
62
+ [example | description | pointer to more information | …] <!-- optional -->
63
+
64
+ * Good, because [argument a]
65
+ * Good, because [argument b]
66
+ * Bad, because [argument c]
67
+ * … <!-- numbers of pros and cons can vary -->
68
+
69
+ ## Links <!-- optional -->
70
+
71
+ * [Link type] [Link to ADR] <!-- example: Refined by [ADR-0005](0005-example.md) -->
72
+ * … <!-- numbers of links can vary -->
@@ -25,12 +25,13 @@ module KubernetesTemplateRendering
25
25
  op.banner = "Usage: #{$PROGRAM_NAME} --rendered-directory=<directory> <template directory>"
26
26
 
27
27
  op.on("--rendered-directory=RENDERED_DIRECTORY", "set the directory where rendered output is written") { args.rendered_directory = _1 }
28
- op.on("--[no-]fork", "disable/enable fork") { |fork| args.fork = fork }
28
+ op.on("--[no-]fork", "disable/enable fork") { args.fork = _1 }
29
29
  op.on("--makeflags=MAKEFLAGS", "pass through makeflags so that we can infer fork preference from -j") { args.makeflags = _1 }
30
30
  op.on("--jsonnet_library_path=JSONNET_LIBRARY_PATH", "set the jsonnet library path") { args.jsonnet_library_path = _1 }
31
31
  op.on("--cluster_type=CLUSTER_TYPE", "set the specific cluster type to render") { args.cluster_type = _1 }
32
32
  op.on("--region=REGION", "set the specific region to render") { args.region = _1 }
33
33
  op.on("--color=COLOR", "set the specific color to render") { args.color = _1 }
34
+ op.on("--[no-]prune", "enable/disable pruning of untouched resources") { args.prune = _1 }
34
35
 
35
36
  op.on("--variable-override=KEY:VALUE", "override a variable value set within definitions.yaml") do |override|
36
37
  args.variable_overrides ||= {}
@@ -11,7 +11,8 @@ module KubernetesTemplateRendering
11
11
  :cluster_type,
12
12
  :region,
13
13
  :color,
14
- :variable_overrides
14
+ :variable_overrides,
15
+ :prune
15
16
  ) do
16
17
  def valid?
17
18
  rendered_directory && template_directory
@@ -25,6 +26,10 @@ module KubernetesTemplateRendering
25
26
  end
26
27
  end
27
28
 
29
+ def prune?
30
+ !!prune
31
+ end
32
+
28
33
  def render_files?
29
34
  true
30
35
  end
@@ -63,6 +63,7 @@ module KubernetesTemplateRendering
63
63
  end
64
64
 
65
65
  def render_create_directory(args, output_directory)
66
+ prune_directory(output_directory) if args.prune?
66
67
  create_directory(output_directory)
67
68
  puts "Rendering templates to: #{Color.magenta(output_directory)}"
68
69
  puts "Variable assignments:"
@@ -167,6 +168,17 @@ module KubernetesTemplateRendering
167
168
  end
168
169
  end
169
170
 
171
+ def prune_directory(directory)
172
+ if File.exist?(directory)
173
+ puts <<~MESSAGE
174
+
175
+ The `prune` flag is set to true, #{Color.green('pruning')} directory #{Color.magenta(directory)} before rendering
176
+
177
+ MESSAGE
178
+ FileUtils.rm_rf("#{directory}/*")
179
+ end
180
+ end
181
+
170
182
  def resources(output_directory)
171
183
  @resources[output_directory] ||= standard_resources(output_directory) + grouped_resources(output_directory)
172
184
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KubernetesTemplateRendering
4
- VERSION = "0.1.0.pre.1"
4
+ VERSION = "0.1.0"
5
5
  end
data/mkdocs.yml ADDED
@@ -0,0 +1,9 @@
1
+ site_name: "Kubernetes Template Rendering Gem"
2
+ site_description: "A light weight gem used to render Kubernetes manifest templates written in Jsonnet and ERB"
3
+
4
+ nav:
5
+ - Introduction: README.md
6
+ - Change Log: CHANGELOG.md
7
+
8
+ plugins:
9
+ - techdocs-core
@@ -0,0 +1,4 @@
1
+ module KubernetesTemplateRendering
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes_template_rendering
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Octothorpe
@@ -67,6 +67,10 @@ files:
67
67
  - CHANGELOG.md
68
68
  - README.md
69
69
  - Rakefile
70
+ - catalog-info.yaml
71
+ - docs/CHANGELOG.md
72
+ - docs/README.md
73
+ - docs/adrs/0000-template.md
70
74
  - exe/render_templates
71
75
  - lib/kubernetes_template_rendering.rb
72
76
  - lib/kubernetes_template_rendering/cli.rb
@@ -80,7 +84,8 @@ files:
80
84
  - lib/kubernetes_template_rendering/template.rb
81
85
  - lib/kubernetes_template_rendering/template_directory_renderer.rb
82
86
  - lib/kubernetes_template_rendering/version.rb
83
- - sig/invoca/kubernetes_templates.rbs
87
+ - mkdocs.yml
88
+ - sig/kubernetes_template_rendering.rbs
84
89
  homepage: https://github.com/Invoca/kubernetes_template_rendering
85
90
  licenses: []
86
91
  metadata:
@@ -99,9 +104,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
99
104
  version: 3.1.0
100
105
  required_rubygems_version: !ruby/object:Gem::Requirement
101
106
  requirements:
102
- - - ">"
107
+ - - ">="
103
108
  - !ruby/object:Gem::Version
104
- version: 1.3.1
109
+ version: '0'
105
110
  requirements: []
106
111
  rubygems_version: 3.4.21
107
112
  signing_key:
@@ -1,6 +0,0 @@
1
- module Invoca
2
- module KubernetesTemplateRendering
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
5
- end
6
- end