ky 0.3.1 → 0.3.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
  SHA1:
3
- metadata.gz: df487ad250e2395a8c8bc222c91eb6589b45061e
4
- data.tar.gz: ac2af6afe971f9109f0a08055e7c8a59e12e1eac
3
+ metadata.gz: 5e6457f14235fff459007114725f30bc21c98c8e
4
+ data.tar.gz: 79e288a71402fed10584f55ca4c1dccac9cb6c28
5
5
  SHA512:
6
- metadata.gz: 01c9c765ac943de2bc7bcbd2812e2dd1423d6a498f1e890ffc0832ee68f2991ab0419359f760471a2c4f859802c68859a26a4310cad8a9ca17f572f1752ee147
7
- data.tar.gz: ae3f3802b3f6fba297206ea322b60de7c70e62f362b7de9ecee2c625954ee0c0cf1eb16074509d9f261733426f1b2622a25321d7e87dfc9dd6fe5df516f16544
6
+ metadata.gz: 8d24974efdd05b58bdd32483ab43e5bac1f0b7be4c87100105cb10751d119c555f1691fa0c6a6b6f208cefd18bf72d526eaecda4f61f6bca614c76598cb5f86d
7
+ data.tar.gz: 0a3cb75f0eb527b1ecc8efe997551a61665d50936af73a0a547f1cbd9231004428b1980402bbe217106c5b33d0b6c6cbeb5a034e597223eab20d335ab01896b1
data/lib/ky.rb CHANGED
@@ -23,7 +23,7 @@ module KY
23
23
  inline_config: true,
24
24
  inline_secret: false,
25
25
  project_name: "global"
26
- }
26
+ }.stringify_keys
27
27
 
28
28
  module_function
29
29
  cattr_accessor :environment, :image_tag
@@ -55,7 +55,7 @@ module KY
55
55
  deploys_hash.each do |file_path, deploy_hash|
56
56
  File.write(file_path, Manipulation.merge_hash(deploy_hash, env_obj.to_h).to_yaml)
57
57
  end
58
- Manipulation.write_configs_encode_if_needed(env_obj.config_hsh, env_obj.secret_hsh, full_output_dir)
58
+ Manipulation.write_configs_encode_if_needed(env_obj.config_hsh, env_obj.secret_hsh, full_output_dir, configuration["project_name"])
59
59
  end
60
60
 
61
61
  def configuration
@@ -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}-deployment.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
 
@@ -46,13 +46,13 @@ module KY
46
46
  ENV['DATA_KEY'] || DEFAULT_DATA_KEY
47
47
  end
48
48
 
49
- def write_configs_encode_if_needed(config_hsh, secret_hsh, output_path)
49
+ def write_configs_encode_if_needed(config_hsh, secret_hsh, output_path, project_name)
50
50
  if secret_hsh[obscured_data_key].values.detect {|value| BASE_64_DETECTION_REGEX =~ value }
51
- File.write("#{output_path}/secret.yml", secret_hsh.to_yaml)
51
+ File.write("#{output_path}/#{project_name}.secret.yml", secret_hsh.to_yaml)
52
52
  else
53
- File.write("#{output_path}/secret.yml", code_yaml(StringIO.new(secret_hsh.to_yaml), :encode))
53
+ File.write("#{output_path}/#{project_name}.secret.yml", code_yaml(StringIO.new(secret_hsh.to_yaml), :encode))
54
54
  end
55
- File.write("#{output_path}/configmap.yml", config_hsh.to_yaml)
55
+ File.write("#{output_path}/#{project_name}.configmap.yml", config_hsh.to_yaml)
56
56
  end
57
57
 
58
58
  end
@@ -1,3 +1,3 @@
1
1
  module KY
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -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-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
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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Glusman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-26 00:00:00.000000000 Z
11
+ date: 2016-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec