Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
aptible-cli (0.24.8)
aptible-cli (0.24.9)
activesupport (>= 4.0, < 6.0)
aptible-api (~> 1.8.0)
aptible-auth (~> 1.2.5)
Expand Down
16 changes: 16 additions & 0 deletions lib/aptible/cli/helpers/vhost/option_set_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class OptionSetBuilder
ports
port
alb
shared
).freeze

def initialize(&block)
Expand Down Expand Up @@ -122,6 +123,15 @@ def declare_options(thor)
'on this Endpoint'
)
end

if builder.shared?
option(
:shared,
type: :boolean,
desc: "Share this Endpoint's load balancer with other " \
'Endpoints'
)
end
end
end

Expand Down Expand Up @@ -192,6 +202,12 @@ def prepare(account, options)
end
params[:load_balancing_algorithm_type] = lba_type
end

if shared?
params[:shared] = options.delete(:shared) do
create? ? false : nil
end
end
end

options.delete(:environment)
Expand Down
1 change: 1 addition & 0 deletions lib/aptible/cli/resource_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def inject_vhost(node, vhost, service)
node.value('port', port)
node.value('load_balancing_algorithm_type', vhost
.load_balancing_algorithm_type)
node.value('shared', vhost.shared)
end

node.value('internal', vhost.internal)
Expand Down
2 changes: 2 additions & 0 deletions lib/aptible/cli/subcommands/endpoints.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def self.included(thor)
port!
tls!
alb!
shared!
end

desc 'endpoints:https:create [--app APP] SERVICE',
Expand All @@ -179,6 +180,7 @@ def self.included(thor)
port!
tls!
alb!
shared!
end

desc 'endpoints:https:modify [--app APP] ENDPOINT_HOSTNAME',
Expand Down
2 changes: 1 addition & 1 deletion lib/aptible/cli/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Aptible
module CLI
VERSION = '0.24.8'.freeze
VERSION = '0.24.9'.freeze
end
end
4 changes: 3 additions & 1 deletion spec/aptible/cli/resource_formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def capture(m, *args)
ip_whitelist: [],
default: false,
acme: false,
load_balancing_algorithm_type: 'least_outstanding_requests'
load_balancing_algorithm_type: 'least_outstanding_requests',
shared: false
)

expected = [
Expand All @@ -32,6 +33,7 @@ def capture(m, *args)
'Type: https',
'Port: default',
'Load Balancing Algorithm Type: least_outstanding_requests',
'Shared: false',
'Internal: false',
'IP Whitelist: all traffic',
'Default Domain Enabled: false',
Expand Down