Skip to content

Commit

Permalink
action: Allow setting multiple port fwds
Browse files Browse the repository at this point in the history
This is going to be used to expose dockerd.

Signed-off-by: Martynas Pumputis <[email protected]>
  • Loading branch information
brb committed Jul 8, 2024
1 parent 363c642 commit 7027c1c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ inputs:
required: true
default: 'false'
port-forward:
description: 'Additional to SSH port forward ($LOCAL:$VM_PORT)'
description: 'Additional to SSH comma-separated port forwards ($LOCAL:$VM_PORT)'
required: false
runs:
using: "composite"
Expand Down Expand Up @@ -167,7 +167,10 @@ runs:
extraArgs+=("--verbose")
fi
if [ "${{ inputs.port-forward }}" != "" ]; then
extraArgs+=("-p" "${{ inputs.port-forward }}")
fwds=($(echo "${{ inputs.port-forward }}" | tr "," "\n"))
for fwd in "${fwds[@]}"; do
extraArgs+=("-p" "$fwd")
done
fi
sudo touch /tmp/console.log
sudo /bin/lvh run --host-mount=${{ inputs.host-mount }} --image ${{ inputs.images-folder-parent }}/images/${{ steps.derive-image-name.outputs.image-name }}.qcow2 \
Expand Down

0 comments on commit 7027c1c

Please sign in to comment.