Change on Dockerfile
This commit is contained in:
parent
e82d84dcdd
commit
e12784daec
@ -5,4 +5,4 @@ COPY entrypoint.sh /home/entrypoint.sh
|
|||||||
# Grant executable permission on the script.
|
# Grant executable permission on the script.
|
||||||
RUN ["chmod", "+x", "/home/entrypoint.sh"]
|
RUN ["chmod", "+x", "/home/entrypoint.sh"]
|
||||||
# Runs the script.
|
# Runs the script.
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
ENTRYPOINT [ "/home/entrypoint.sh" ]
|
@ -1,12 +1,17 @@
|
|||||||
#!/bin/sh -l
|
#!/bin/sh -l
|
||||||
|
|
||||||
|
# Checking if the key input is not empty
|
||||||
if [[ "$INPUT_KEY" ]]; then
|
if [[ "$INPUT_KEY" ]]; then
|
||||||
echo -e "${INPUT_KEY}" > key
|
# If it is not emty, it uses the key for the SCP
|
||||||
chmod 400 key
|
echo -e "${INPUT_KEY}" > key # Creates a file with the key content
|
||||||
|
chmod 400 key # Set the key as Read-Only
|
||||||
echo "Trying SCP process with SSH key"
|
echo "Trying SCP process with SSH key"
|
||||||
|
# Runs the SCP command
|
||||||
scp -P $INPUT_PORT -o StrictHostKeyChecking=no -i key $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
scp -P $INPUT_PORT -o StrictHostKeyChecking=no -i key $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
||||||
else
|
else
|
||||||
|
# If the keyis emty, it uses the password for the SCP
|
||||||
echo "Trying SCP process with password"
|
echo "Trying SCP process with password"
|
||||||
|
# Runs the SCP command
|
||||||
sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
sshpass -p $INPUT_PASSWORD scp -P $INPUT_PORT -o StrictHostKeyChecking=no $INPUT_ORIGIN "$INPUT_USERNAME"@"$INPUT_HOST":"$INPUT_DESTINATION"
|
||||||
fi
|
fi
|
||||||
echo "Files successfully copied"
|
echo "Files successfully copied"
|
Loading…
Reference in New Issue
Block a user