Changed from /bin/bash to /bin/sh which is busybox for alpine

This commit is contained in:
Marco Dalla Santa
2022-03-22 15:02:57 +00:00
parent afa413dc37
commit fc430f0194
5 changed files with 8 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ name: Test
on: on:
push: push:
branches: branches:
- main - feature-use_sh_instead_of_bash
jobs: jobs:
test-key: test-key:

View File

@@ -3,8 +3,7 @@ FROM alpine:latest
RUN apk update && \ RUN apk update && \
apk add --no-cache ca-certificates \ apk add --no-cache ca-certificates \
openssh-client \ openssh-client \
sshpass \ sshpass
bash
COPY LICENSE README.md / COPY LICENSE README.md /
COPY entrypoint.sh with_key.sh with_pass.sh / COPY entrypoint.sh with_key.sh with_pass.sh /

View File

@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
PASSWORD=${INPUT_PASSWORD}; PASSWORD=${INPUT_PASSWORD};
KEY=${INPUT_KEY}; KEY=${INPUT_KEY};

View File

@@ -1,3 +1,5 @@
#!/bin/sh
echo "🔑 Adding ssh key..." && echo "🔑 Adding ssh key..." &&
eval $(ssh-agent -s) && eval $(ssh-agent -s) &&
ssh-add <(echo "${INPUT_KEY}") && ssh-add <(echo "${INPUT_KEY}") &&

View File

@@ -1,3 +1,5 @@
#!/bin/sh
PRE_UPLOAD=${INPUT_PRE_UPLOAD} PRE_UPLOAD=${INPUT_PRE_UPLOAD}
if [ ! -z "$PRE_UPLOAD" ]; then 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}" && 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 "🙌 Uploaded via scp"
} || { } || {
echo "😢 Something went wrong during upload" && exit 1  echo "😢 Something went wrong during upload" && exit 1
} }
POST_UPLOAD=${INPUT_POST_UPLOAD} POST_UPLOAD=${INPUT_POST_UPLOAD}