fix quotes in SCP commands

This commit is contained in:
Radosław Kukuczka
2025-03-30 12:34:33 +02:00
parent 3338ad6b87
commit ed7e3b721f

View File

@@ -1,7 +1,8 @@
name: 'Prepare Remote NFS Directories' name: 'Prepare Remote NFS Directories'
description: | description: |
Creates specified directories on a remote server (NFS mount) via SSH. Optionally prefixes directories Creates specified directories on a remote NFS-mounted server via SSH.
with a provided short SHA to isolate deployments. Skips execution if no directories are specified. Optionally prefixes directories with a provided short SHA to isolate deployments.
Skips execution if no directories are specified.
inputs: inputs:
ssh_host: ssh_host:
@@ -16,7 +17,7 @@ inputs:
directories: directories:
description: | description: |
Newline-separated list of local directories to create remotely and copy contents from. Newline-separated list of local directories to create remotely and copy contents from.
Example: | Example:
config config
public/images public/images
public/icons public/icons
@@ -70,11 +71,11 @@ runs:
echo "DEBUG: Creating remote directory $REMOTE_DIR" echo "DEBUG: Creating remote directory $REMOTE_DIR"
ssh -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" \ ssh -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" \
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}" \ "${{ inputs.ssh_user }}@${{ inputs.ssh_host }}" \
"mkdir -p \"$REMOTE_DIR\" && chmod -R 755 \"$REMOTE_DIR\"" "mkdir -p '$REMOTE_DIR' && chmod -R 755 '$REMOTE_DIR'"
echo "DEBUG: Copying contents from local '$LOCAL_DIR' to remote '$REMOTE_DIR'" echo "DEBUG: Copying contents from local '$LOCAL_DIR' to remote '$REMOTE_DIR'"
scp -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" -r "$LOCAL_DIR/"* \ scp -o StrictHostKeyChecking=no -i "$SSH_KEY_FILE" -r "$LOCAL_DIR/"* \
"${{ inputs.ssh_user }}@${{ inputs.ssh_host }}:\"$REMOTE_DIR/\"" || echo "DEBUG: No files to copy in '$LOCAL_DIR'" "${{ inputs.ssh_user }}@${{ inputs.ssh_host }}:'$REMOTE_DIR/'" || echo "DEBUG: No files to copy in '$LOCAL_DIR'"
CREATED_PATHS+="$REMOTE_DIR"$'\n' CREATED_PATHS+="$REMOTE_DIR"$'\n'
else else