Created
December 22, 2015 10:49
-
-
Save x-cray/434b2b93da83d8be864c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% raw %} | |
{{range $service := services}}{{range $tag := $service.Tags}} | |
{{$servicePort := $service.Name | regexReplaceAll "^[\\w-]+?(\\d*)$" "$1"}}{{$tagPort := $tag | regexReplaceAll "^[\\w-]+?(\\d*)$" "$1"}} | |
{{if or (not $servicePort) (eq $servicePort $tagPort)}} | |
{{if $tag | regexMatch "internal-listen-http-\\d+"}} | |
## | |
# Production internal http frontend for {{$service.Name}} | |
## | |
frontend internal_http_in_production:{{$service.Name}} | |
bind :{{$tag | replaceAll "internal-listen-http-" ""}} | |
use_backend cluster_production:{{$service.Name}} | |
## | |
# Staging internal http frontend for {{$service.Name}} | |
## | |
frontend internal_http_in_staging:{{$service.Name}} | |
bind :1{{$tag | replaceAll "internal-listen-http-" ""}} | |
use_backend cluster_staging:{{$service.Name}} | |
{{end}} | |
{{end}} | |
{{end}}{{end}} | |
{% endraw %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment