Last active
January 22, 2023 19:10
-
-
Save gimmi/881d7362e0ed196a2e70b84112320a79 to your computer and use it in GitHub Desktop.
bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1 | |
FROM busybox:musl | |
# IMPORTANT: line ending must be LF, indentation must be tabs | |
COPY --chmod=777 <<-EOF /wait.sh | |
#!/bin/sh | |
trap 'pkill sleep' INT TERM | |
echo 'Started, press Ctrl+C to stop' | |
sleep infinity & | |
wait | |
echo 'Stopped' | |
EOF | |
ENTRYPOINT ["/wait.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
cd "$(dirname "$0")" | |
if ! git --no-pager -C bastion-scripts diff-index --quiet HEAD; then | |
echo "ERROR: Commit before sync" | |
exit 1 | |
fi | |
# GIT_COMMENT="$1" | |
# git --no-pager -C "$SCRIPT_DIR" add -A | |
# git --no-pager -C "$SCRIPT_DIR" commit -a -m "${GIT_COMMENT}" | |
# git --no-pager -C "$SCRIPT_DIR" push | |
rm -f bastion-scripts.tar | |
git --no-pager -C bastion-scripts ls-files | while read -r git_path; do | |
tar --append --verbose --file bastion-scripts.tar "bastion-scripts/${git_path}" | |
done | |
# ssh -i ~/.ssh/bastion-rke rke@192.168.201.105 mkdir --parents bastion-scripts | |
scp -o StrictHostKeyChecking=no -i ~/.ssh/id_oiadp bastion-scripts.tar oiadp@192.168.201.105:~ | |
ssh -oStrictHostKeyChecking=no -i ~/.ssh/id_oiadp oiadp@192.168.201.105 tar --extract --overwrite --verbose --file bastion-scripts.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
trap 'pkill sleep' INT TERM | |
echo 'Started, press Ctrl+C to stop' | |
sleep infinity & | |
wait | |
echo 'Stopping' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment