add option to expose ports per instance
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Robert Kaussow 2021-01-15 14:16:17 +01:00
parent 6e09e8556a
commit b70741069f
No known key found for this signature in database
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: # provider_config:
# - name: DRONE_HETZNERCLOUD_DATACENTER # - name: DRONE_HETZNERCLOUD_DATACENTER
# value: fsn1-dc14 # value: fsn1-dc14
@ -142,7 +144,7 @@ droneci_autoscaler_networks:
- name: droneci_default - name: droneci_default
external: True external: True
# @var droneci_autoscaler_exposed_ports: $ "_unset_" droneci_autoscaler_exposed_ports: []
# @var droneci_autoscaler_exposed_ports:example: > # @var droneci_autoscaler_exposed_ports:example: >
# droneci_autoscaler_exposed_ports: # droneci_autoscaler_exposed_ports:
# - "8080:8080" # - "8080:8080"

View File

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