Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2472407cca | ||
|
|
02f9674b7a |
@@ -128,7 +128,8 @@ jobs:
|
||||
|
||||
docker run --rm --net=host \
|
||||
-v "$(pwd):/workspace" -w /workspace \
|
||||
-v "${HOME}/.ssh:/root/.ssh:ro" \
|
||||
-v "/root/.ssh:/root/.ssh:ro" \
|
||||
-v "/home/ubuntu/.ssh:/home/ubuntu/.ssh:ro" \
|
||||
-e TARGET_HOST="${TARGET_HOST}" \
|
||||
-e TARGET_USER="${TARGET_USER}" \
|
||||
-e PORT="${PORT}" \
|
||||
@@ -136,13 +137,11 @@ jobs:
|
||||
alpine:latest sh -c '
|
||||
apk add --no-cache openssh-client rsync && \
|
||||
KEY_ARG="" && \
|
||||
if [ -f /root/.ssh/gitea_ci_key ]; then \
|
||||
KEY_ARG="-i /root/.ssh/gitea_ci_key -o IdentitiesOnly=yes" ; \
|
||||
elif [ -f /root/.ssh/id_ed25519 ]; then \
|
||||
KEY_ARG="-i /root/.ssh/id_ed25519 -o IdentitiesOnly=yes" ; \
|
||||
elif [ -f /root/.ssh/id_rsa ]; then \
|
||||
KEY_ARG="-i /root/.ssh/id_rsa -o IdentitiesOnly=yes" ; \
|
||||
fi && \
|
||||
for k in /root/.ssh/gitea_ci_key /home/ubuntu/.ssh/gitea_ci_key /root/.ssh/id_ed25519 /root/.ssh/id_rsa; do \
|
||||
if [ -f "$k" ]; then \
|
||||
KEY_ARG="-i $k -o IdentitiesOnly=yes" && break ; \
|
||||
fi ; \
|
||||
done && \
|
||||
SSH_CMD="ssh -p ${PORT} ${KEY_ARG} -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=15" && \
|
||||
echo "Deploying backup script and .env to DB Server (${TARGET_USER}@${TARGET_HOST}:${DEST_DIR})..." && \
|
||||
$SSH_CMD "${TARGET_USER}@${TARGET_HOST}" "mkdir -p ${DEST_DIR}/scripts" && \
|
||||
|
||||
Reference in New Issue
Block a user