|
@ -20,8 +20,17 @@ capacity="$(options-get capacity)" || true |
|
|
|
|
|
|
|
|
name=${name:-"$(hostname)/$SERVICE_NAME"} |
|
|
name=${name:-"$(hostname)/$SERVICE_NAME"} |
|
|
capacity=${capacity:-2} |
|
|
capacity=${capacity:-2} |
|
|
## YYY should implement labels (see https://docs.drone.io/reference/agent/drone-runner-labels/) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
service_def=$(get_compose_service_def "$SERVICE_NAME") || exit 1 |
|
|
|
|
|
labels_def=$(e "$service_def" | shyaml get-value options.labels) || true |
|
|
|
|
|
[ "$labels_def" == None ] && labels_def="" |
|
|
|
|
|
if [ "$labels_def" ]; then |
|
|
|
|
|
labels="" |
|
|
|
|
|
while read-0 label value; do |
|
|
|
|
|
var+="$label:$value," |
|
|
|
|
|
done < <(printf "%s" "$labels_def" | shyaml key-values-0) |
|
|
|
|
|
labels="${var::-1}" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
init-config-add "\ |
|
|
init-config-add "\ |
|
|
$MASTER_BASE_SERVICE_NAME: |
|
|
$MASTER_BASE_SERVICE_NAME: |
|
@ -30,6 +39,7 @@ $MASTER_BASE_SERVICE_NAME: |
|
|
DRONE_RPC_SECRET: $secret |
|
|
DRONE_RPC_SECRET: $secret |
|
|
DRONE_RUNNER_NAME: $name |
|
|
DRONE_RUNNER_NAME: $name |
|
|
DRONE_RUNNER_CAPACITY: $capacity |
|
|
DRONE_RUNNER_CAPACITY: $capacity |
|
|
|
|
|
$([ "$labels" ] && echo "DRONE_RUNNER_LABELS: '$labels'") |
|
|
volumes: |
|
|
volumes: |
|
|
- /var/run/docker.sock:/var/run/docker.sock |
|
|
- /var/run/docker.sock:/var/run/docker.sock |
|
|
" |
|
|
" |