ky 0.3.0beta1 → 0.3.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
  SHA1:
3
- metadata.gz: eff2da2223846540c4f8bb47a3bb59684215b698
4
- data.tar.gz: 793e1b97792108e5feada8ec4969cec526a73875
3
+ metadata.gz: 3a1450afbdf79d14f2d16fde12d7776a3f902c88
4
+ data.tar.gz: 0251fb3c63c8ec51aad1a5e3dd0d793344a204d7
5
5
  SHA512:
6
- metadata.gz: 1e02009691a0503ff6d92af8799577792fd9fac9205cfb3c2f7fd9ca88b58c0d2ca38547c95689ee1c646f900488008e534181b1ddf176368fcc337c8a2fe460
7
- data.tar.gz: 21727d8f5bbec27b5278b7db6837c508517784c37d33d5300956d85912a53b5318656c150060a122fd2529621f5c8234afae791860139da494a54e81e8283924
6
+ metadata.gz: aa0d08b5c026b6a20f41220fa9967a1e7230b01e40b0eb43fb25926444de55df527574bfded3c0249040d857f7fb4ef79613ac64472de36effc1dc5e49ef8d68
7
+ data.tar.gz: 2067a16f3f92c53091db6346de4e7b41eb10b4c9e8a66a8a6d6b90995f4878faacf19f6944f5395dca598e8a4fe82a32f9cad77bc2ba4537155a3ceedf706ff6
data/examples/.ky.yml CHANGED
@@ -13,3 +13,11 @@ config_path: "spec/support/config.yml"
13
13
  secret_path: "spec/support/decoded.yml"
14
14
  output_dir: "namespaces"
15
15
  procfile_path: "spec/support/Procfile"
16
+ merge:
17
+ web:
18
+ spec:
19
+ template:
20
+ spec:
21
+ containers:
22
+ - ports:
23
+ - containerPort: 3000
data/lib/ky.rb CHANGED
@@ -67,8 +67,9 @@ module KY
67
67
  end
68
68
  end
69
69
 
70
- def current_deployment
71
- current_environment_hash["deployment"]
70
+ def deploy_merge(id)
71
+ return {} unless configuration["merge"]
72
+ configuration["merge"][id].to_h
72
73
  end
73
74
 
74
75
  def current_environment_hash(partial_config=nil)
@@ -19,7 +19,7 @@ module KY
19
19
 
20
20
  def to_h
21
21
  proc_commands.map do |id, command_array|
22
- ["#{full_output_dir}/#{id}.yml", template_hash(id, command_array)]
22
+ ["#{full_output_dir}/#{id}-deployment.yml", template_hash(id, command_array)]
23
23
  end.to_h
24
24
  end
25
25
 
@@ -41,7 +41,12 @@ module KY
41
41
  def template_hash(id, command_array)
42
42
  app_name = KY.configuration['app_name'] || "#{project_name}-#{id}"
43
43
  template_context = Template.context(app_name: app_name, id: id, command_array: command_array)
44
- YAML.load(ERB.new(deployment_yaml).result(template_context))
44
+ Manipulation.merge_hash(
45
+ YAML.load(
46
+ ERB.new(deployment_yaml).result(template_context)
47
+ ),
48
+ KY.deploy_merge(id)
49
+ )
45
50
  end
46
51
  end
47
52
  end
@@ -52,7 +52,7 @@ module KY
52
52
  else
53
53
  File.write("#{output_path}/secret.yml", code_yaml(StringIO.new(secret_hsh.to_yaml), :encode))
54
54
  end
55
- File.write("#{output_path}/config.yml", config_hsh.to_yaml)
55
+ File.write("#{output_path}/configmap.yml", config_hsh.to_yaml)
56
56
  end
57
57
 
58
58
  end
data/lib/ky/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KY
2
- VERSION = "0.3.0beta1"
2
+ VERSION = "0.3.0"
3
3
  end
data/spec/ky_bin_spec.rb CHANGED
@@ -68,9 +68,9 @@ describe "cli commands" do
68
68
  let(:tmpdir) { 'spec/support/tmpdir' }
69
69
  it "to directory" do
70
70
  KY::Cli.new.compile('spec/support/Procfile', 'spec/support/config.yml', 'spec/support/decoded.yml', tmpdir)
71
- expect(File.exists?("#{tmpdir}/web.yml")).to be true
72
- expect(File.exists?("#{tmpdir}/worker.yml")).to be true
73
- expect(File.exists?("#{tmpdir}/jobs.yml")).to be true
71
+ expect(File.exists?("#{tmpdir}/web-deployment.yml")).to be true
72
+ expect(File.exists?("#{tmpdir}/worker-deployment.yml")).to be true
73
+ expect(File.exists?("#{tmpdir}/jobs-deployment.yml")).to be true
74
74
  `rm -r #{tmpdir}`
75
75
  end
76
76
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0beta1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Glusman
@@ -119,9 +119,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  version: '0'
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.1
124
+ version: '0'
125
125
  requirements: []
126
126
  rubyforge_project: ky
127
127
  rubygems_version: 2.5.1