kubes 0.7.1 → 0.7.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: f5e5ce606ff32f7d8083b1c8d6bdff1745700ec971ce7bc0a13a72b5ab370e2a
4
- data.tar.gz: 2ff9e9cee9c77e227157ffd701504baf4831b2ed66678db7a7b5248303bc02cb
3
+ metadata.gz: 3a5b3cde73260cb3fdcb98eb32357de95112ebb253ec38c82ee14828253cf704
4
+ data.tar.gz: 7251020f3a8c71c09f0cbcb6ed05fa801201a133064a6522df7f6ad439cfef24
5
5
  SHA512:
6
- metadata.gz: 5af79490b1ce56d61a08fcbd2d4c05d442d0b965a030c9ef3a95b74b8276a368065b9d3d340344920e2b5a38e77161be904b11755c55a17e351ce04b891f7725
7
- data.tar.gz: cd83c382860483bbbb9c3a4d462def4e8551dc80a8453d171918190bcd82f9cdd4bef351cbaa1a8222cd1dd3ad6e53d128d279a23cee03636142104b6b923192
6
+ metadata.gz: f9ee9fbfcae307f81105f48cdd69a8a86f120d464d5ec7c1b8d02fc54ebac0e9a033fc3da8ecf46d72f1b96f2b0b86da39046392de533321ae385c20e5eb49ae
7
+ data.tar.gz: 67434cdf1ea6a0babb94da14369f332950a55394f46b89616fa41e6dc10c8a99fe6562ad25e01b069f31e99411e5e1581fd29fd5021b1a394289670956c5ed15
@@ -3,6 +3,10 @@
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.7.2] - 2020-12-04
7
+ - [#43](https://github.com/boltops-tools/kubes/pull/43) store docker image name in env based folder
8
+ - fix kubes help
9
+
6
10
  ## [0.7.1] - 2020-11-16
7
11
  - [#42](https://github.com/boltops-tools/kubes/pull/42) load helpers for dsl properly
8
12
  - fix merge layer
@@ -18,5 +18,5 @@ logger.level | Logger level. Can also be set with `KUBES_LOG_LEVEL` env var | in
18
18
  repo | The Docker repo to use. Required to be set. | nil
19
19
  repo_auto_auth | Whether or not to try to auth authorize docker repo registry if not yet logged in. Can also be set with env var `KUBES_REPO_AUTO_AUTO` | true
20
20
  skip | List of resources to skip. Can also be set with the `KUBES_SKIP` env var. `KUBES_SKIP` should be a list of strings separated by spaces. It adds onto the `config.skip` option. | []
21
- state.docker_image_path | Where to store the state file with the last build Docker image. | .kubes/state/docker_image.txt
21
+ state.path | Where to store the state file with the last build Docker image. | .kubes/state/KUBES_env/data.json
22
22
  suffix_hash | Whether or not to append suffix hash to ConfigMap and Secret | true
@@ -16,7 +16,7 @@ Kubes uses the image from the `--image` option if specified. It's a quick way to
16
16
 
17
17
  kubes deploy --image repo/image:tag
18
18
 
19
- When the `--image` option is set, Kubes skips the Docker build phase.
19
+ When the `--image` option is set, Kubes skips the Docker build phase. You can also set `config.image = false` to simply disable image building.
20
20
 
21
21
  ## 2. Kubes Config
22
22
 
@@ -30,7 +30,7 @@ Kubes.configure do |config|
30
30
  end
31
31
  ```
32
32
 
33
- When `config.image` is set, Kubes skips the Docker build phase.
33
+ When `config.image` is set, Kubes skips the Docker build phase. You can also set `config.image = false` to simply disable image building.
34
34
 
35
35
  ## 3. Built Docker Image
36
36
 
@@ -1,14 +1,14 @@
1
1
  ---
2
- title: Multiple Enviroments with Layering
3
- nav_text: Multiple Enviroments
2
+ title: Multiple Environments with Layering
3
+ nav_text: Multiple Environments
4
4
  categories: patterns
5
5
  ---
6
6
 
7
- You can use Kubes to easily create multiple enviroments with the same YAML configs. This is thanks to [Kubes Layering]({% link _docs/layering.md %}). We'll walk through an example to help understand how it works.
7
+ You can use Kubes to easily create multiple environments with the same YAML configs. This is thanks to [Kubes Layering]({% link _docs/layering.md %}). We'll walk through an example to help understand how it works.
8
8
 
9
- ## Creating Multiple Enviroments
9
+ ## Creating Multiple Environments
10
10
 
11
- To create multiple enviroments like dev and prod just change KUBES_ENV. Example:
11
+ To create multiple environments like dev and prod just change KUBES_ENV. Example:
12
12
 
13
13
  KUBES_ENV=dev kubes deploy
14
14
  KUBES_ENV=prod kubes deploy
@@ -17,7 +17,7 @@ Different env files will be layered and merged to produce YAML files specific to
17
17
 
18
18
  ## Project Structure
19
19
 
20
- Here's an example structure, so we can understand how layering works to create multiple enviroments.
20
+ Here's an example structure, so we can understand how layering works to create multiple environments.
21
21
 
22
22
  .kubes/resources/
23
23
  ├── base
@@ -78,12 +78,12 @@ Multiple resources layering structure.
78
78
 
79
79
  .kubes/resources/
80
80
  ├── base
81
- │ ├── all.rb # SINGULAR
82
- │ └── deployment.rb # SINGULAR
81
+ │ ├── all.yaml # SINGULAR
82
+ │ └── deployment.yaml # SINGULAR
83
83
  └── web
84
- ├── deployments # PLURAL
85
- │ ├── dev.rb # SINGULAR
86
- │ └── prod.rb # SINGULAR
87
- └── deployments.rb # PLURAL
84
+ ├── deployments # PLURAL
85
+ │ ├── dev.yaml # SINGULAR
86
+ │ └── prod.yaml # SINGULAR
87
+ └── deployments.yaml # PLURAL
88
88
 
89
89
  The main difference is the pluralized filenames.
@@ -16,7 +16,7 @@ class Kubes::CLI
16
16
 
17
17
  # auto build docker image and push image if kubes docker build not yet called
18
18
  def build_docker_image
19
- return if File.exist?("#{Kubes.root}/.kubes/state/docker_image.txt")
19
+ return if File.exist?(Kubes.config.state.path)
20
20
  Build.new(@options).run
21
21
  end
22
22
  end
@@ -57,6 +57,7 @@ module Kubes
57
57
  end
58
58
 
59
59
  def check_project!(command_name)
60
+ return if command_name.nil?
60
61
  return if %w[-h -v completion completion_script help init new version].include?(command_name)
61
62
  Kubes.check_project!
62
63
  end
@@ -1,4 +1,5 @@
1
1
  require "base64"
2
+ require "json"
2
3
 
3
4
  module Kubes::Compiler::Shared
4
5
  module Helpers
@@ -17,11 +18,12 @@ module Kubes::Compiler::Shared
17
18
  end
18
19
 
19
20
  def built_image_helper
20
- path = Kubes.config.state.docker_image_path
21
+ path = Kubes.config.state.path
21
22
  unless File.exist?(path)
22
23
  raise Kubes::MissingDockerImage.new("Missing file with docker image built by kubes: #{path}. Try first running: kubes docker build")
23
24
  end
24
- IO.read(path)
25
+ data = JSON.load(IO.read(path))
26
+ data['image']
25
27
  end
26
28
 
27
29
  def with_extra(value)
@@ -39,7 +39,7 @@ module Kubes
39
39
  config.skip = []
40
40
 
41
41
  config.state = ActiveSupport::OrderedOptions.new
42
- config.state.docker_image_path = "#{Kubes.root}/.kubes/state/docker_image.txt"
42
+ config.state.path = "#{Kubes.root}/.kubes/state/#{Kubes.env}/data.json"
43
43
 
44
44
  config.suffix_hash = true # append suffix hash to ConfigMap and Secret
45
45
 
@@ -1,3 +1,5 @@
1
+ require "json"
2
+
1
3
  module Kubes::Docker::Strategy
2
4
  module ImageName
3
5
  extend Memoist
@@ -13,12 +15,13 @@ module Kubes::Docker::Strategy
13
15
  # Only when a new docker build command gets run will the image name state be updated.
14
16
  def store_image_name
15
17
  FileUtils.mkdir_p(File.dirname(image_state_path))
16
- IO.write(image_state_path, @@image_name)
18
+ text = JSON.pretty_generate(image: @@image_name)
19
+ IO.write(image_state_path, text)
17
20
  end
18
21
 
19
22
  # output can get entirely wiped so dont use that folder
20
23
  def image_state_path
21
- Kubes.config.state.docker_image_path
24
+ Kubes.config.state.path
22
25
  end
23
26
 
24
27
  # full_image - Includes the tag. Examples:
@@ -33,7 +36,8 @@ module Kubes::Docker::Strategy
33
36
  logger.error "ERROR: Unable to find #{image_state_path} which contains the last docker image name built with kubes build. Please run `kubes docker build` first."
34
37
  exit 1
35
38
  end
36
- IO.read(image_state_path).strip
39
+ data = JSON.load(IO.read(image_state_path))
40
+ data['image']
37
41
  end
38
42
 
39
43
  @@timestamp = Time.now.strftime('%Y-%m-%dT%H-%M-%S')
@@ -1,3 +1,3 @@
1
1
  module Kubes
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
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.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tung Nguyen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-11-16 00:00:00.000000000 Z
11
+ date: 2020-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport