kpr-genesis/scripts/run_pipeline.sh

17 lines
336 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
LOCK="$HOME/.infra.lock"
exec 200>$LOCK
flock -n 200 || { echo "pipeline already running"; exit 0; }
cd "$(dirname "$0")/.."
#git pull --ff-only
export TF_IN_AUTOMATION=1
terraform -chdir=terraform init -upgrade
terraform -chdir=terraform apply -auto-approve
ansible-playbook ansible/site.yml