From fc430f01941b89094f81f26c34503e585a546384 Mon Sep 17 00:00:00 2001 From: Marco Dalla Santa Date: Tue, 22 Mar 2022 15:02:57 +0000 Subject: [PATCH] Changed from /bin/bash to /bin/sh which is busybox for alpine --- .github/workflows/main.yml | 2 +- Dockerfile | 3 +-- entrypoint.sh | 2 +- with_key.sh | 2 ++ with_pass.sh | 4 +++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4c7a02..e19c77c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,7 @@ name: Test on: push: branches: - - main + - feature-use_sh_instead_of_bash jobs: test-key: diff --git a/Dockerfile b/Dockerfile index bdc6f99..9a1cf23 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 / diff --git a/entrypoint.sh b/entrypoint.sh index c0a7dfb..08a4b24 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh PASSWORD=${INPUT_PASSWORD}; KEY=${INPUT_KEY}; diff --git a/with_key.sh b/with_key.sh index c20364a..1fbdc8c 100644 --- a/with_key.sh +++ b/with_key.sh @@ -1,3 +1,5 @@ +#!/bin/sh + echo "🔑 Adding ssh key..." && eval $(ssh-agent -s) && ssh-add <(echo "${INPUT_KEY}") && diff --git a/with_pass.sh b/with_pass.sh index e11664b..72ad8ae 100644 --- a/with_pass.sh +++ b/with_pass.sh @@ -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}