add option to expose ports per instance
continuous-integration/drone/push Build was killed Details

This commit is contained in:
Robert Kaussow 2021-01-15 14:16:17 +01:00
parent 6e09e8556a
commit b70741069f
Signed by: xoxys
GPG Key ID: 65362AE74AF98B61
2 changed files with 5 additions and 3 deletions

View File

@ -85,6 +85,8 @@ droneci_autoscaler_instances: []
# }
# }
# }
# exposed_ports:
# - "8080:8080"
# provider_config:
# - name: DRONE_HETZNERCLOUD_DATACENTER
# value: fsn1-dc14
@ -142,7 +144,7 @@ droneci_autoscaler_networks:
- name: droneci_default
external: True
# @var droneci_autoscaler_exposed_ports: $ "_unset_"
droneci_autoscaler_exposed_ports: []
# @var droneci_autoscaler_exposed_ports:example: >
# droneci_autoscaler_exposed_ports:
# - "8080:8080"

View File

@ -7,9 +7,9 @@ services:
container_name: {{ inst.name }}
image: {{ droneci_autoscaler_image }}
restart: {{ droneci_autoscaler_restart_policy }}
{% if droneci_autoscaler_exposed_ports | default([]) %}
{% if inst.exposed_ports | default(droneci_autoscaler_exposed_ports) | lenght > 0 %}
ports:
{% for port in droneci_autoscaler_exposed_ports %}
{% for port in inst.exposed_ports | default(droneci_autoscaler_exposed_ports) %}
- {{ port | quote }}
{% endfor %}
{% endif %}