pfab 0.54.1 → 0.55.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: 76cf1e72c2d80c355fdcd4d6a1d4029966302d885106239d4f440b02cd1ecec0
4
- data.tar.gz: a89e2b49a230499c16dfacd205b9a025529a72f99bd9d89d0e143d7d90fdbce8
3
+ metadata.gz: e4e570424c14765d734c759cd70fb07bf192cf7eb9aa23df4009d79db22ead61
4
+ data.tar.gz: 3aa1fb2f697b3d83c32cedb45b0714bb11f88831a62aecb081b845d256543763
5
5
  SHA512:
6
- metadata.gz: f8250a9a5c42ebdfb55d22c076c4a6be32a1c2596b720b2e77e60b35c86e92879116df789cdda86571e26ce2a0f2e9c1b3da7f4c4bc1edfa60ee81bb8115bc1e
7
- data.tar.gz: c1517c24b3d9cde49f77a65b02084b3e200869d529c4c08753378761cb5466ef7ceda829438d65d29cd30718183d7bd4a3fd8fc73684e238167286dc0e88e0f2
6
+ metadata.gz: 625f06742f7996deb0640d74b95c4507bebac36bd95a1e1511c807db959257cc3ab04c7e6f5b36d0182bca0d5616fb3c55273c0eb8bd3893ea5bce7ef54e8d1d
7
+ data.tar.gz: 232d06bb3f3855d4f8cc109dd819be7d1f03a9e742a2087795c784608c4d07be9d50ebac2617dc85df604c1b66b6f9c257c0970f1ebb7fe632adec8352d429dd
data/Gemfile CHANGED
@@ -12,7 +12,7 @@ gem 'styled_yaml', '~> 0.0.1'
12
12
  # Add dependencies to develop your gem here.
13
13
  # Include everything needed to run rake, tests, features, etc.
14
14
  group :development do
15
- gem "rdoc", "~> 3.12"
15
+ gem "rdoc", "~> 6.1"
16
16
  gem "bundler", "~> 2.3"
17
17
  gem "juwelier", "~> 2.4.9", git: "https://github.com/flajann2/juwelier"
18
18
  gem "simplecov", ">= 0"
data/Gemfile.lock CHANGED
@@ -67,7 +67,7 @@ GEM
67
67
  highline (1.7.10)
68
68
  i18n (1.14.5)
69
69
  concurrent-ruby (~> 1.0)
70
- json (1.8.6)
70
+ json (2.6.3)
71
71
  jwt (2.3.0)
72
72
  kamelcase (0.0.2)
73
73
  semver2 (~> 3)
@@ -99,8 +99,7 @@ GEM
99
99
  rack (3.0.11)
100
100
  rake (13.0.6)
101
101
  rchardet (1.8.0)
102
- rdoc (3.12.2)
103
- json (~> 1.4)
102
+ rdoc (6.1.2.1)
104
103
  ruby2_keywords (0.0.5)
105
104
  semver2 (3.4.2)
106
105
  simplecov (0.16.1)
@@ -125,7 +124,7 @@ DEPENDENCIES
125
124
  commander
126
125
  juwelier (~> 2.4.9)!
127
126
  pry-byebug
128
- rdoc (~> 3.12)
127
+ rdoc (~> 6.1)
129
128
  simplecov
130
129
  styled_yaml (~> 0.0.1)
131
130
  test-unit
data/README.markdown CHANGED
@@ -243,7 +243,7 @@ Releasing
243
243
  - ```bundle exec rake gemspec```
244
244
  - ```git commit ```
245
245
  - ```REMOTE_BRANCH=main LOCAL_BRANCH=main bundle exec rake git:release```
246
- - ```REMOTE_BRANCH=main LOCAL_BRANCH=main bundle exec rake build```
246
+ - ```REMOTE_BRANCH=main LOCAL_BRANCH=main bundle exec rake clean build```
247
247
  - ```gem push pkg/pfab-0.45.0.gem```
248
248
 
249
249
  Copyright
data/launch.rb ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # this file can be used to run CLI locally for debugging etc
3
+ $LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
4
+ require "pfab"
5
+
6
+ Pfab::CLI.new.run
@@ -62,7 +62,7 @@ module Pfab
62
62
  end
63
63
 
64
64
  def deploy_id
65
- "#{@data['application']}.#{application_type}.#{@data['deployed_name']}"
65
+ @data['deployed_name']
66
66
  end
67
67
 
68
68
  def deploy_unique_id
@@ -5,22 +5,30 @@ module Pfab
5
5
  module Templates
6
6
  class Web < Base
7
7
  def write_to(f)
8
- if get("host").nil?
9
- puts "No host to deploy to for #{@data['deployed_name']}. Skipping."
8
+ if ingres_enabled? && get("host").nil?
9
+ puts "No host to configure ingress for #{@data['deployed_name']}. Skipping deployment. add a host or generateIngressEnabled:false"
10
10
  else
11
11
  f << StyledYAML.dump(service.deep_stringify_keys)
12
- if not app_vars.has_key?('generateIngressEnabled') || app_vars['generateIngressEnabled']
12
+ if ingres_enabled?
13
13
  f << StyledYAML.dump(ingress.deep_stringify_keys)
14
14
  else
15
15
  puts "skipping ingress because ingress_disabled = #{@data['generateIngressEnabled']}"
16
16
  end
17
17
  f << StyledYAML.dump(deployment.deep_stringify_keys)
18
- if get("replicas") || 1 > 1
18
+ replica_count = get("replicas") ||1
19
+ if (replica_count > 1)
19
20
  f << StyledYAML.dump(pod_disruption_budget.deep_stringify_keys)
20
21
  end
21
22
  end
22
23
  end
23
24
 
25
+ def ingres_enabled?
26
+ if not app_vars.has_key?('generateIngressEnabled') || app_vars['generateIngressEnabled']
27
+ return true
28
+ end
29
+ return false
30
+ end
31
+
24
32
  def service
25
33
  {
26
34
  apiVersion: "v1",
@@ -41,7 +49,7 @@ module Pfab
41
49
  ports: [
42
50
  {
43
51
  name: "http",
44
- port: 80,
52
+ port: app_vars["service_listen_port"] || 80,
45
53
  targetPort: app_vars["port"],
46
54
  appProtocol: app_vars["appProtocol"]
47
55
  }.compact
data/lib/pfab/version.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  module Pfab
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 54
5
- PATCH = 1
4
+ MINOR = 55
5
+ PATCH = 0
6
6
  BUILD = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
data/lib/pfab/yamls.rb CHANGED
@@ -24,6 +24,11 @@ module Pfab
24
24
  template.env_vars
25
25
  end
26
26
 
27
+ def env_from(app)
28
+ template = Pfab::Templates::Base.new(data_for(app, @apps[app]))
29
+ template.env_from
30
+ end
31
+
27
32
  def data_for(app, props)
28
33
  data = @base_data.clone
29
34
  data['props'] = props
data/pfab.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pfab 0.54.1 ruby lib
5
+ # stub: pfab 0.55.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pfab".freeze
9
- s.version = "0.54.1"
9
+ s.version = "0.55.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Jeff Dwyer".freeze]
14
- s.date = "2024-05-15"
14
+ s.date = "2024-05-22"
15
15
  s.description = "k8s helper".freeze
16
16
  s.email = "jdwyer@prefab.cloud".freeze
17
17
  s.executables = ["pfab".freeze]
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
29
29
  "README.markdown",
30
30
  "Rakefile",
31
31
  "bin/pfab",
32
+ "launch.rb",
32
33
  "lib/pfab.rb",
33
34
  "lib/pfab/cli.rb",
34
35
  "lib/pfab/templates/base.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pfab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.54.1
4
+ version: 0.55.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dwyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-15 00:00:00.000000000 Z
11
+ date: 2024-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: commander
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.12'
75
+ version: '6.1'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.12'
82
+ version: '6.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: bundler
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -154,6 +154,7 @@ files:
154
154
  - README.markdown
155
155
  - Rakefile
156
156
  - bin/pfab
157
+ - launch.rb
157
158
  - lib/pfab.rb
158
159
  - lib/pfab/cli.rb
159
160
  - lib/pfab/templates/base.rb