Skip to content

Commit

Permalink
Merge pull request #4 from funkwerk/feature/udp_ports
Browse files Browse the repository at this point in the history
added support for udp ports
  • Loading branch information
lindt authored Aug 23, 2016
2 parents c5da29f + 85b0461 commit 106e977
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion compose_plantuml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
34 changes: 13 additions & 21 deletions features/boundaries.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
- <port>
"""
When I run `bin/compose_plantuml --boundaries compose.yml`
Then it should pass with exactly:
Expand All @@ -19,29 +19,21 @@ Feature: Boundaries
cloud system {
[service]
}
[service] --> 8080
[service] --> <resulting port>
"""

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: TCP Port
| port | resulting port |
| 8080 | 8080 |

"""
Examples: UDP Port
| port | resulting port |
| 8080/udp | 8080udp |

Examples: Alias Port
| port | resulting port |
| 8080:80 | 8080 : 80 |

Scenario: Volumes
Given a file named "compose.yml" with:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 106e977

Please sign in to comment.