diff options
author | EuAndreh <eu@euandre.org> | 2019-05-28 02:14:05 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-05-28 02:20:00 -0300 |
commit | 6b6af477cb7296279d317cf584a0020e0201156d (patch) | |
tree | cc016501a7bfd2324e97c4437537eb261a296b2a | |
parent | Remove git rev-parse from .envrc (diff) | |
download | server-6b6af477cb7296279d317cf584a0020e0201156d.tar.gz server-6b6af477cb7296279d317cf584a0020e0201156d.tar.xz |
Split scripts into CI and VPS box
-rwxr-xr-x | deploy.sh | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | scripts/box/bash-aliases.sh (renamed from bash_aliases.sh) | 0 | ||||
-rwxr-xr-x | scripts/box/run-backup-template.sh (renamed from run-backup-template.sh) | 0 | ||||
-rwxr-xr-x | scripts/ci/provision.sh (renamed from provision.sh) | 3 | ||||
-rwxr-xr-x | scripts/ci/setup.sh (renamed from ci-setup.sh) | 1 |
5 files changed, 4 insertions, 2 deletions
@@ -31,7 +31,7 @@ echo "Done." echo "Copy over files..." ssh "$TLD" mkdir -p /home/vps/ ssh "$TLD" 'grep /home/vps/ /root/.profile || echo "cd /home/vps/" >> /root/.profile' -scp bash_aliases.sh "$TLD":/root/.bash_aliases +scp ./scripts/box/bash-aliases.sh "$TLD":/root/.bash_aliases envsubst < docker-compose.yaml | ssh "$TLD" 'cat > /home/vps/docker-compose.yaml' echo "Done." diff --git a/bash_aliases.sh b/scripts/box/bash-aliases.sh index 4ef035d..4ef035d 100644..100755 --- a/bash_aliases.sh +++ b/scripts/box/bash-aliases.sh diff --git a/run-backup-template.sh b/scripts/box/run-backup-template.sh index 34184b9..34184b9 100755 --- a/run-backup-template.sh +++ b/scripts/box/run-backup-template.sh diff --git a/provision.sh b/scripts/ci/provision.sh index a4b077b..9572ea7 100755 --- a/provision.sh +++ b/scripts/ci/provision.sh @@ -3,12 +3,13 @@ # shellcheck shell=bash set -Eeuo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" +cd ../../ echo "Shutting down running containers and backing up data..." ssh "$TLD" "cd /home/vps/ && docker-compose down" scp ./secrets/borg_remote.pub "$TLD":/root/.ssh/id_rsa.pub scp ./secrets/borg_remote "$TLD":/root/.ssh/id_rsa -VPS_COMMIT_SHA="$(git rev-parse HEAD)" envsubst < run-backup-template.sh | ssh "$TLD" 'cat > /home/vps/run-backup.sh && chmod +x /home/vps/run-backup.sh' +VPS_COMMIT_SHA="$(git rev-parse HEAD)" envsubst < ./scripts/box/run-backup-template.sh | ssh "$TLD" 'cat > /home/vps/run-backup.sh && chmod +x /home/vps/run-backup.sh' ssh "$TLD" /home/vps/run-backup.sh echo "Done." diff --git a/ci-setup.sh b/scripts/ci/setup.sh index 4c38993..b6ab06f 100755 --- a/ci-setup.sh +++ b/scripts/ci/setup.sh @@ -3,6 +3,7 @@ # shellcheck shell=bash set -Eeuo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" +cd ../../ echo "Unlocking git-crypt repos..." git crypt unlock |