mirror of
https://gitee.com/jiulinxiri/ssh-scp-deploy.git
synced 2025-09-10 02:15:25 +08:00
Changed from /bin/bash to /bin/sh which is busybox for alpine
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -3,7 +3,7 @@ name: Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- feature-use_sh_instead_of_bash
|
||||
|
||||
jobs:
|
||||
test-key:
|
||||
|
@@ -3,8 +3,7 @@ FROM alpine:latest
|
||||
RUN apk update && \
|
||||
apk add --no-cache ca-certificates \
|
||||
openssh-client \
|
||||
sshpass \
|
||||
bash
|
||||
sshpass
|
||||
|
||||
COPY LICENSE README.md /
|
||||
COPY entrypoint.sh with_key.sh with_pass.sh /
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
|
||||
PASSWORD=${INPUT_PASSWORD};
|
||||
KEY=${INPUT_KEY};
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
echo "🔑 Adding ssh key..." &&
|
||||
eval $(ssh-agent -s) &&
|
||||
ssh-add <(echo "${INPUT_KEY}") &&
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
PRE_UPLOAD=${INPUT_PRE_UPLOAD}
|
||||
if [ ! -z "$PRE_UPLOAD" ]; then
|
||||
{
|
||||
@@ -14,7 +16,7 @@ fi
|
||||
sshpass -p ${PASSWORD} scp ${INPUT_SSH_OPTIONS} ${INPUT_SCP_OPTIONS} -P "${INPUT_PORT}" -r ${INPUT_LOCAL} ${INPUT_USER}@${INPUT_HOST}:"${INPUT_REMOTE}" &&
|
||||
echo "🙌 Uploaded via scp"
|
||||
} || {
|
||||
echo "😢 Something went wrong during upload" && exit 1
|
||||
echo "😢 Something went wrong during upload" && exit 1
|
||||
}
|
||||
|
||||
POST_UPLOAD=${INPUT_POST_UPLOAD}
|
||||
|
Reference in New Issue
Block a user