Skip to content

Commit 01a41a7

Browse files
committed
update
1 parent a0f44d2 commit 01a41a7

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
dry-stack (0.1.43)
4+
dry-stack (0.1.44)
55

66
GEM
77
remote: https://rubygems.org/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This gem allows ...
66
cat simple_stack.drs | dry-stack -e to_compose | docker stack deploy -c - simple_stack
77
88
$ dry-stack
9-
Version: 0.1.43
9+
Version: 0.1.44
1010
Usage:
1111
dry-stack -s stackfile [options] COMMAND
1212
cat stackfile | dry-stack COMMAND

lib/dry-stack/stack.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def to_compose(opts = @options)
190190

191191
if ing[:host_sni]
192192
domain = opts[:tls_domain] || 'example.com'
193-
domain = ing[:host_sni].gsub('.*', ".#{domain}")
193+
domain = ing[:host_sni].gsub('.*', ".#{domain}") if ing[:host_sni]&.include?('*')
194194
domain = ing[:tls_domain] if ing[:tls_domain]
195195

196196
ing[:passthrough] = false unless ing.key? :passthrough
@@ -218,7 +218,7 @@ def to_compose(opts = @options)
218218

219219
if opts[:traefik_tls]
220220
domain = opts[:tls_domain] || 'example.com'
221-
domain = ing[:host].gsub('.*', ".#{domain}") if ing[:host]
221+
domain = ing[:host].gsub('.*', ".#{domain}") if ing[:host]&.include?('*')
222222
domain = ing[:tls_domain] if ing[:tls_domain]
223223
service[:deploy][:labels] += [
224224
"traefik.http.routers.#{service_name}-#{index}.tls=true",

lib/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Dry
22
class Stack
3-
VERSION = '0.1.43'
3+
VERSION = '0.1.44'
44
end
55
end

spec/data/stack1-compose.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,22 @@ services:
153153
target: "/dev/shm"
154154
tmpfs:
155155
size: 4096000000
156+
front:
157+
environment:
158+
STACK_NAME: simple_stack
159+
STACK_SERVICE_NAME: front
160+
deploy:
161+
labels:
162+
- stack.product=product A
163+
- traefik.enable=true
164+
- traefik.http.routers.simple_stack_front-0.service=simple_stack_front-0
165+
- traefik.http.services.simple_stack_front-0.loadbalancer.server.port=7000
166+
- traefik.http.routers.simple_stack_front-0.rule=HostRegexp(`{name:.*}`)
167+
networks:
168+
default:
169+
ingress_routing:
170+
init: true
171+
image: reports:0.1
156172
networks:
157173
default:
158174
attachable: true

spec/data/stack1.drs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,6 @@ Service :reports2, image: 'reports:0.1', env: {DB_URL: '$DB_URL'}, ports: 7000 d
4949
volume source: nil, type: 'tmpfs', target: '/dev/shm', tmpfs: { size: 4096000000 }
5050
end
5151

52+
Service :front, image: 'reports:0.1', ports: 7000, ingress: { host: '*' }
53+
5254
Network :default, attachable: true

0 commit comments

Comments
 (0)