aboutsummaryrefslogtreecommitdiff
path: root/scripts/deploy
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-03-07 19:12:06 -0300
committerEuAndreh <eu@euandre.org>2022-03-07 19:12:06 -0300
commit5bf9572734025ddbe680c0c4978f72df5718ae4b (patch)
tree032d09b77a32538740bdf56e028c3e24fa7c35af /scripts/deploy
parentTODOs.md: Add #td-dae28289-0b87-f931-8911-97cd810c9507 (diff)
downloadserver-5bf9572734025ddbe680c0c4978f72df5718ae4b.tar.gz
server-5bf9572734025ddbe680c0c4978f72df5718ae4b.tar.xz
Delete all old code and configuration to start from scratch with Guix only
Delete files related to: - Terraform - opt/* - scripts/deploy - secrets/* - git-crypt - Nix
Diffstat (limited to 'scripts/deploy')
-rwxr-xr-xscripts/deploy54
1 files changed, 0 insertions, 54 deletions
diff --git a/scripts/deploy b/scripts/deploy
deleted file mode 100755
index d4a0128..0000000
--- a/scripts/deploy
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-set -eu
-
-usage() {
- cat <<EOF
-Usage:
- $0 HOSTNAME
-
-Examples:
- $0 kuvira
-EOF
-}
-
-NAME="${1:-}"
-if [ -z "$NAME" ]; then
- printf 'Missing HOSTNAME\n' >&2
- usage >&2
- exit 2
-fi
-
-FILE="$(find . -name hostname.txt -exec grep -l "^$NAME$" {} \;)"
-if [ -z "$FILE" ]; then
- printf 'Unknown hostname "%s"\n' "$NAME" >&2
- exit 2
-fi
-
-DIR="$(dirname "$FILE")"
-
-cd "$DIR"
-. ./tf-env.sh
-terraform init
-terraform apply
-cd - > /dev/null
-
-TLD="$(cat "$DIR"/tld.txt)"
-DIRS='/opt /srv'
-# shellcheck disable=2029
-ssh "$TLD" "\
- sudo mkdir -p $DIRS && \
- sudo chown $USER:users -R $DIRS && \
- chmod -R 755 $DIRS
-"
-
-rsync -avzPL opt "$DIR/opt" "$TLD":/
-
-if [ -f "$DIR"/machines.scm ]; then
- guix deploy "$DIR"/machines.scm
-elif [ -f "$DIR"/configuration.nix ]; then
- scp "$DIR"/configuration.nix "$TLD":/etc/nixos/
- ssh "$TLD" sudo nixos-rebuild switch
-else
- printf 'Uknown deploy type for "%s"\n' "$NAME" >&2
- exit 2
-fi