diff options
Diffstat (limited to 'scripts/ci/provision.sh')
-rwxr-xr-x | scripts/ci/provision.sh | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/ci/provision.sh b/scripts/ci/provision.sh index 3ba89d9..56e481a 100755 --- a/scripts/ci/provision.sh +++ b/scripts/ci/provision.sh @@ -9,22 +9,21 @@ VPS_COMMIT_SHA="$(git rev-parse HEAD)" export VPS_COMMIT_SHA echo "Shutting down running containers and backing up data..." ssh "$TLD" "cd /home/vps/ && docker-compose down" -scp ./secrets/borg_remote.pub "$TLD":/root/.ssh/id_rsa.pub -scp ./secrets/borg_remote "$TLD":/root/.ssh/id_rsa -envsubst < ./scripts/box/run-backup-template.sh | ssh "$TLD" 'cat > /home/vps/run-backup.sh && chmod +x /home/vps/run-backup.sh' +scp ./secrets/borg/borg_remote.pub "$TLD":/root/.ssh/id_rsa.pub +scp ./secrets/borg/borg_remote "$TLD":/root/.ssh/id_rsa +envsubst < ./scripts/box/run-backup.env.sh | ssh "$TLD" 'cat > /home/vps/run-backup.sh && chmod +x /home/vps/run-backup.sh' ssh "$TLD" /home/vps/run-backup.sh echo "Done." echo "Running 'terraform plan' and storing the planfile..." -# Terraform plan terraform --version terraform init mkdir -p "../vps-state/secrets/plan-files/" PLAN_FILE_NAME="$(date -Iseconds)-$VPS_COMMIT_SHA.tfplan" PLAN_FILE_PATH="../vps-state/secrets/plan-files/$PLAN_FILE_NAME" + terraform plan -input=false -out="$PLAN_FILE_PATH" -# Store on git repo pushd ../vps-state/ git add "secrets/plan-files/$PLAN_FILE_NAME" git commit -m "CI: add .tfplan plan file for CI run $VPS_COMMIT_SHA" @@ -44,6 +43,10 @@ git push origin master popd echo "Done." +echo "Running the Ansible playbook..." +ansible-playbook provision.yaml +echo "Done." + echo "Locking git-crypt repositories back..." git crypt lock pushd ../vps-state/ |