adding terraform to sarpdate

This commit is contained in:
Andy Pack 2023-03-04 23:21:41 +00:00
parent 2b1a316575
commit b6f2c5b33f
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7

View File

@ -1,33 +1,44 @@
#!/usr/bin/env bash
echo ">> updating everything....."
echo
echo
echo ">> updating local brew dependencies...."
echo
brew update
echo
echo
echo ">> which leaves these outdated...."
echo
brew outdated
echo
read -p ">> upgrade? (y/n) " updatebrew
if [ updatebrew = "y" ]; then
if [ $updatebrew == "y" ]; then
echo ">> upgrading......"
brew upgrade
fi
echo
echo
echo ">> updating ansible environment...."
cd ~/dev/infra/ansible
poetry update
echo ">> checking terraform diff...."
cd ~/dev/infra/terraform
terraform plan
echo
read -p ">> apply terraform changes? (y/n) " updateterraform
if [ $updateterraform == "y" ]; then
echo ">> applying......"
terraform apply -auto-approve
fi
echo
read -p ">> update ansible environment? (y/n) " updateansible
if [ $updateansible == "y" ]; then
echo ">> upgrading......"
cd ~/dev/infra/ansible
poetry update
fi
echo
echo ">> running a few playbooks...."
echo
cd ~/dev/infra/ansible
./update