kubes 0.9.1 → 0.9.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2481a18249c348869a45a16c59ab5718f7e0e0eabb0ad5d613720e162b0b6150
4
- data.tar.gz: baab953af69e63ee3697dc995abdac3a49e734d825d4b60dbe253618c0adea69
3
+ metadata.gz: edae65d07f29eedd785441b4c1d125d26639fb6f19cf1b70df170bcd76c2cf15
4
+ data.tar.gz: 40ac1292d4b6913b650f418733f84506084ffb183841c69881103a882b7edf8a
5
5
  SHA512:
6
- metadata.gz: db322cd2a2c7154f56f6980b2e76319d211ad84290d8d5fbf1ce11e502b65260a2f7b9202636cf59d9a03a25ed84d96024598e97117a465679383cd733679cce
7
- data.tar.gz: 67e8ad348fd9bebc223c2b83c038c74999f7e1afc573fe94a989b161f7f1fde6cd35410b9fb120497dd93f565009f0793d6d8bc8208721f0aefd98324d4d6ed4
6
+ metadata.gz: d77eefb3b34963ff4b1441b274051f009123aca06295fbe31f42e755d06a601f86ebc335140714fd1b638e37181d3a4397e0164ec4fa8c3f6b8c89664a2d96e4
7
+ data.tar.gz: 674d50dd8e780b9aa751fc1fac16831a1bdb431e80a306ffd61552d075aa6e5bcbe644f868b2f8273f0df5a6a20ef91eb35f002384b0767dbf2b3c1024cc870c
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/), even before v1.0.
5
5
 
6
+ ## [0.9.3] - 2022-10-20
7
+ - [#69](https://github.com/boltops-tools/kubes/pull/69) improve config map multiple files support
8
+
9
+ ## [0.9.2] - 2022-10-10
10
+ - [#68](https://github.com/boltops-tools/kubes/pull/68) kubes docker name
11
+ - KUBES_IMAGE_TAG env var override ability
12
+
6
13
  ## [0.9.1] - 2022-08-24
7
14
  - [#67](https://github.com/boltops-tools/kubes/pull/67) small improvement to show layering: show compiled output path
8
15
 
@@ -7,6 +7,7 @@ Name | Description | Default
7
7
  auto_prune | Prune and delete old hashed resources like Secret and ConfigMap. | true
8
8
  builder | What docker build command to use. Can use `docker` or `gcloud` to build the Docker image. | docker
9
9
  image | Set a prebuilt Docker image to use. This is optional. Usually, you want to build an image from the Dockerfile. Setting this will change the `docker_image` helper to use a predefined image. See: [Docker Image]({% link _docs/intro/docker-image.md %}) | nil
10
+ image_tag | Normally, kubes will generate an image tag name. You can explicitly set it instead. IE: `latest` | nil
10
11
  kubectl.context | What kubectl context to auto-switch to. | nil
11
12
  kubectl.context_keep | Whether or not to keep the context switched | false
12
13
  kubectl.exit_on_fail.apply | Whether or not continue if the `kubectl apply` fails. Note, can use `KUBES_EXIT_ON_FAIL=0` env var to set to false. | true
@@ -9,7 +9,25 @@ class Kubes::CLI
9
9
  push if options[:push]
10
10
  end
11
11
 
12
- desc "push IMAGE", "Push the docker image."
12
+ desc "name", "Print the full docker image with tag that was last generated."
13
+ long_desc Help.text("docker:name")
14
+ option :name, type: :boolean, default: false
15
+ def name
16
+ builder = Kubes::Docker.new(options, "build")
17
+ name = builder.read_image_name
18
+ if name
19
+ puts name
20
+ else
21
+ $stderr.puts(<<~EOL)
22
+ WARN: docker image has not yet been built. Please first run:
23
+
24
+ kubes docker build
25
+
26
+ EOL
27
+ end
28
+ end
29
+
30
+ desc "push", "Push the docker image."
13
31
  long_desc Help.text("docker:push")
14
32
  option :push, type: :boolean, default: false
15
33
  def push
@@ -2,8 +2,13 @@ module Kubes::Compiler::Shared::Helpers
2
2
  module ConfigMapHelper
3
3
  def config_map_files(options={})
4
4
  indent = options[:indent] || 2
5
+ # /path/to/app/.kubes/resources/shared/config_map.yaml:7:in `__tilt_4660'
6
+ line = caller[0]
7
+ path = line.split(':').first
8
+ basename = File.basename(path).sub(/.erb$/,'').sub(/.yaml$/, '').sub(/.rb$/, '')
9
+ filename = options[:name] || basename
5
10
 
6
- shared_config_map = "#{Kubes.root}/.kubes/resources/shared/config_map"
11
+ shared_config_map = "#{Kubes.root}/.kubes/resources/shared/#{filename}"
7
12
  layers = [
8
13
  [shared_config_map, "base.txt"],
9
14
  [shared_config_map, "#{Kubes.env}.txt"],
@@ -19,6 +19,12 @@ module Kubes::Docker::Strategy
19
19
  IO.write(image_state_path, text)
20
20
  end
21
21
 
22
+ def read_image_name
23
+ return unless File.exist?(image_state_path)
24
+ data = IO.read(image_state_path).strip
25
+ JSON.load(data)['image']
26
+ end
27
+
22
28
  # output can get entirely wiped so dont use that folder
23
29
  def image_state_path
24
30
  Kubes.config.state.path
@@ -43,7 +49,8 @@ module Kubes::Docker::Strategy
43
49
  @@timestamp = Time.now.strftime('%Y-%m-%dT%H-%M-%S')
44
50
  def generate_name
45
51
  # IE: tongueroo/demo:kubes-
46
- ["#{repo}:kubes-#{@@timestamp}", git_sha].compact.join('-')
52
+ tag = ENV['KUBES_IMAGE_TAG'] || Kubes.config.image_tag || ["kubes-#{@@timestamp}", git_sha].compact.join('-')
53
+ "#{repo}:#{tag}"
47
54
  end
48
55
 
49
56
  def repo
data/lib/kubes/docker.rb CHANGED
@@ -15,5 +15,8 @@ module Kubes
15
15
  klass_name = "Kubes::Docker::Strategy::#{@name.camelize}::#{strategy}"
16
16
  klass_name.constantize
17
17
  end
18
+
19
+ # For `kubes docker image` and read_image_name method
20
+ include Kubes::Docker::Strategy::ImageName
18
21
  end
19
22
  end
data/lib/kubes/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kubes
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-24 00:00:00.000000000 Z
11
+ date: 2022-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -855,7 +855,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
855
855
  - !ruby/object:Gem::Version
856
856
  version: '0'
857
857
  requirements: []
858
- rubygems_version: 3.3.12
858
+ rubygems_version: 3.3.21
859
859
  signing_key:
860
860
  specification_version: 4
861
861
  summary: 'Kubernetes Deployment Tool: build docker image, compile Kubernetes YAML