Skip to content
Commits on Source (6)
[toplevel]
account = sts get-caller-identity --query 'Account' --output text
account-id = sts get-caller-identity --query 'Account' --output text
whoami = sts get-caller-identity
region = configure get region
ecr-login = !aws ecr get-login-password | podman login --username AWS --password-stdin "$(aws whoami --query "Account" --output text).dkr.ecr.$(aws region).amazonaws.com"
......
# vim: ft=bash
complete -C terraform tf
complete -C tofu tf
# shellcheck shell=bash
# vim: ft=sh
if command -v wormhole >/dev/null
then
eval "$(_WORMHOLE_COMPLETE=bash_source wormhole)"
fi
......@@ -10,16 +10,13 @@ alias tfp='tf init -backend=false && tf plan -out tfplan'
alias tfr='tf apply -auto-approve -refresh-only'
alias tfvf='tf init -backend=false && tf validate && tf fmt -diff'
tfp-next () {
tf-next () {
current="$(tf workspace show)"
next="$(tf workspace list | cut -c3- | grep --line-regexp --after-context=1 "$current" | tail +2)"
tf apply tfplan
tf apply -auto-approve -refresh-only
if [ -z "$next" ]
if [ -z "${next}" ]
then
red "Last workspace in the cycle."
red "Last workspace."
return
fi
tf workspace select "$next"
tf plan -out tfplan "$@"
}
......@@ -8,10 +8,16 @@ usage() {
if [ "$#" -eq 0 ]
then
ssh -t host01.shore.co.il -o \
"RemoteCommand tmux new-session -As backup sudo sh -c 'mount /dev/sdb1 /mnt && offsite-backup /mnt && umount /mnt'"
"RemoteCommand sudo mount /dev/sdb1 /mnt"
ssh host01.shore.co.il -o \
"RemoteCommand sudo -H systemd-run --unit server-backup --collect sh -c 'offsite-backup /mnt && umount /mnt'"
elif [ "$1" = '-c' ]
then
if ssh host01.shore.co.il tmux has-session -t backup 2>/dev/null
if ssh host01.shore.co.il systemctl --system is-failed server-backup.service >/dev/null
then
echo 'Backup failed.'
exit 1
elif ssh host01.shore.co.il systemctl --system is-active server-backup.service >/dev/null
then
echo 'Backup is still running.'
else
......
......@@ -87,9 +87,9 @@ _all() {
! has apt-get || _apt
! has pkg_add || _pkg_add
! has flatpak || _flatpak
! has fwupdmgr || fwupd
! { has wb || wb -i; } || _workbench
! has podman || _presentation
! has fwupdmgr || fwupd
}
list_supported() {
......