From d4e533667a36df94272f55ab428b2a73356be88a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 12 Aug 2020 22:41:34 -0300 Subject: Rename: nixos-update.sh->nixos-switch.sh, terraform-update.sh->terraform-apply.sh --- nixos-switch.sh | 9 +++++++++ nixos-update.sh | 9 --------- terraform-apply.sh | 12 ++++++++++++ terraform-update.sh | 12 ------------ 4 files changed, 21 insertions(+), 21 deletions(-) create mode 100755 nixos-switch.sh delete mode 100755 nixos-update.sh create mode 100755 terraform-apply.sh delete mode 100755 terraform-update.sh diff --git a/nixos-switch.sh b/nixos-switch.sh new file mode 100755 index 0000000..856acb4 --- /dev/null +++ b/nixos-switch.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash +# shellcheck shell=bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +cat <(echo "${USER_PASSWORD}") <(envsubst < vps-configuration.env.nix) | ssh "$TLD" sudo -S 'cat > /etc/nixos/configuration.nix' +echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S nix-channel --add "https://nixos.org/channels/nixos-${SYSTEM_STATE_VERSION}" nixos +echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade diff --git a/nixos-update.sh b/nixos-update.sh deleted file mode 100755 index 856acb4..0000000 --- a/nixos-update.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -# shellcheck shell=bash -set -Eeuo pipefail -cd "$(dirname "${BASH_SOURCE[0]}")" - -cat <(echo "${USER_PASSWORD}") <(envsubst < vps-configuration.env.nix) | ssh "$TLD" sudo -S 'cat > /etc/nixos/configuration.nix' -echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S nix-channel --add "https://nixos.org/channels/nixos-${SYSTEM_STATE_VERSION}" nixos -echo "${USER_PASSWORD}" | ssh "$TLD" sudo -S -i nixos-rebuild switch --upgrade diff --git a/terraform-apply.sh b/terraform-apply.sh new file mode 100755 index 0000000..ac2b9ca --- /dev/null +++ b/terraform-apply.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash +# shellcheck shell=bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +terraform init +PLAN_FILE="./secrets/terraform/plan-files/$(date -Iseconds)" +terraform plan -out="${PLAN_FILE}" +# shellcheck disable=2162 +read -p "Is the above Terraform plan acceptable?." +terraform apply "${PLAN_FILE}" diff --git a/terraform-update.sh b/terraform-update.sh deleted file mode 100755 index ac2b9ca..0000000 --- a/terraform-update.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -# shellcheck shell=bash -set -Eeuo pipefail -cd "$(dirname "${BASH_SOURCE[0]}")" - -terraform init -PLAN_FILE="./secrets/terraform/plan-files/$(date -Iseconds)" -terraform plan -out="${PLAN_FILE}" -# shellcheck disable=2162 -read -p "Is the above Terraform plan acceptable?." -terraform apply "${PLAN_FILE}" -- cgit v1.2.3