add option to expose ports
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Robert Kaussow 2020-10-01 10:34:39 +02:00
parent aab83c4ce3
commit e9f855897e
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61
2 changed files with 16 additions and 0 deletions

View File

@ -58,6 +58,7 @@ droneci_autoscaler_instances: []
# agent_concurrency: 15
# agent_architecture: amd64
# sshkey: "dummy"
# api_host: "drone-amd64.example.com"
# provider_config:
# - name: DRONE_HETZNERCLOUD_DATACENTER
# value: fsn1
@ -111,5 +112,11 @@ droneci_autoscaler_networks:
- name: droneci_default
external: True
# @var droneci_autoscaler_exposed_ports: $ "_unset_"
# @var droneci_autoscaler_exposed_ports:example: >
# droneci_autoscaler_exposed_ports:
# - "8080:8080"
# @end
droneci_autoscaler_networks_applied:
- droneci_default

View File

@ -7,6 +7,12 @@ services:
container_name: {{ inst.name }}
image: {{ droneci_autoscaler_image }}
restart: {{ droneci_autoscaler_restart_policy }}
{% if droneci_autoscaler_exposed_ports | default([]) %}
ports:
{% for port in droneci_autoscaler_exposed_ports %}
- {{ port | quote }}
{% endfor %}
{% endif %}
volumes:
- "{{ __droneci_autoscaler_workdir }}/userdata.yml:/etc/scaler/userdata.yml:Z"
- "{{ __droneci_autoscaler_workdir }}/ssh_key:/root/.ssh/id_rsa:ro,Z"
@ -44,6 +50,9 @@ services:
{% if inst.agent_volumes | default(droneci_autoscaler_agent_volumes) | default(False) %}
- DRONE_AGENT_VOLUMES={{ inst.agent_volumes | default(droneci_autoscaler_agent_volumes) | join(",") }}
{% endif %}
{% if inst.api_host is defined %}
- DRONE_HTTP_HOST={{ inst.api_host }}
{% endif %}
{% if inst.runner_volumes | default(droneci_autoscaler_runner_volumes) | default(False) %}
- DRONE_RUNNER_VOLUMES={{ inst.runner_volumes | default(droneci_autoscaler_runner_volumes) | join(",") }}
{% endif %}