From bf3b553a44b6681388b9ba7670aca7af1a1ffdb1 Mon Sep 17 00:00:00 2001 From: stefan Date: Tue, 23 Aug 2016 23:43:59 +0200 Subject: [PATCH 1/2] added support for udp ports --- compose_plantuml/__init__.py | 2 +- features/boundaries.feature | 20 ++++++++++++++++++++ setup.py | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/compose_plantuml/__init__.py b/compose_plantuml/__init__.py index c0b5533..a94c9a2 100755 --- a/compose_plantuml/__init__.py +++ b/compose_plantuml/__init__.py @@ -74,7 +74,7 @@ def boundaries(self, compose, group=False, ports=True, volumes=True, notes=False port_uml = '' port_links = '' for service, host, container in sorted(self.ports(compose)): - port = host + port = host.replace('/', '') if container is not None: port = '{0} : {1}'.format(host, container) port_links += '[{0}] --> {1}\n'.format(service, port) diff --git a/features/boundaries.feature b/features/boundaries.feature index ad69725..147100f 100644 --- a/features/boundaries.feature +++ b/features/boundaries.feature @@ -23,6 +23,26 @@ Feature: Boundaries """ + Scenario: Exposed UDP ports + Given a file named "compose.yml" with: + """ + version: "2" + services: + service: + ports: + - 8080/udp + """ + When I run `bin/compose_plantuml --boundaries compose.yml` + Then it should pass with exactly: + """ + skinparam componentStyle uml2 + cloud system { + [service] + } + [service] --> 8080udp + + """ + Scenario: Alias Ports Given a file named "compose.yml" with: """ diff --git a/setup.py b/setup.py index 1a4bc3b..508a754 100644 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ def readme(): setup( name='compose_plantuml', - version='0.0.13', + version='0.1.0', description='converts docker-compose into plantuml', long_description=readme(), url='http://github.com/funkwerk/compose_plantuml', From 85b0461d8bd8944401ef8b5da5fd2dc220a417f1 Mon Sep 17 00:00:00 2001 From: stefan Date: Tue, 23 Aug 2016 23:48:57 +0200 Subject: [PATCH 2/2] outlined scenarios --- features/boundaries.feature | 52 +++++++++---------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/features/boundaries.feature b/features/boundaries.feature index 147100f..ec5c715 100644 --- a/features/boundaries.feature +++ b/features/boundaries.feature @@ -3,14 +3,14 @@ Feature: Boundaries I want to see the boundaries of a system so that I know how to interact with it. - Scenario: Exposed ports + Scenario Outline: Exposed ports Given a file named "compose.yml" with: """ version: "2" services: service: ports: - - 8080 + - """ When I run `bin/compose_plantuml --boundaries compose.yml` Then it should pass with exactly: @@ -19,49 +19,21 @@ Feature: Boundaries cloud system { [service] } - [service] --> 8080 + [service] --> """ - Scenario: Exposed UDP ports - Given a file named "compose.yml" with: - """ - version: "2" - services: - service: - ports: - - 8080/udp - """ - When I run `bin/compose_plantuml --boundaries compose.yml` - Then it should pass with exactly: - """ - skinparam componentStyle uml2 - cloud system { - [service] - } - [service] --> 8080udp + Examples: TCP Port + | port | resulting port | + | 8080 | 8080 | - """ + Examples: UDP Port + | port | resulting port | + | 8080/udp | 8080udp | - Scenario: Alias Ports - Given a file named "compose.yml" with: - """ - version: "2" - services: - service: - ports: - - 8080:80 - """ - When I run `bin/compose_plantuml --boundaries compose.yml` - Then it should pass with exactly: - """ - skinparam componentStyle uml2 - cloud system { - [service] - } - [service] --> 8080 : 80 - - """ + Examples: Alias Port + | port | resulting port | + | 8080:80 | 8080 : 80 | Scenario: Volumes Given a file named "compose.yml" with: