#!/usr/bin/env bash set -euo pipefail parent_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" || exit ; pwd -P ) cd "$parent_path" || exit echo "========================================================" echo " Building & Uploading Container Image (Podman)" echo "========================================================" current_version="${1:-latest}" make build-production TAG="$current_version" echo "" echo "========================================================" echo " Executing Ansible Deployment" echo "========================================================" # The play configures rootless Podman Quadlet units that belong to the # connecting user, so it must connect as that user and must NOT become root. # `-u` is the account that owns ~/.config/containers/systemd on the target. deploy_user="${ANSIBLE_USER:-tanshu}" cd "$parent_path/ansible" || exit ansible-playbook -u "$deploy_user" playbook.yml -e "tag=$current_version"