From 2f27af243684d24ee6cea75f17569ec3ef2fc159 Mon Sep 17 00:00:00 2001 From: Zachary Lentz Date: Tue, 26 Mar 2024 10:15:29 -0700 Subject: [PATCH] ENH: prompt user to update deployment docs, providing the necessary info to do so --- scripts/docs_prompt.sh | 13 +++++++++++++ scripts/provision_plc.sh | 3 +++ 2 files changed, 16 insertions(+) create mode 100755 scripts/docs_prompt.sh diff --git a/scripts/docs_prompt.sh b/scripts/docs_prompt.sh new file mode 100755 index 0000000..4da8fc2 --- /dev/null +++ b/scripts/docs_prompt.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# Get version info for inclusion on https://confluence.slac.stanford.edu/x/0IsFGg +# Includes a human-readable shorthand, a url to the commit, and the current time and date +THIS_SCRIPT="$(realpath "${0}")" +THIS_DIR="$(dirname "${THIS_SCRIPT}")" + +VERSION="$(git -C "${THIS_DIR}" describe --tags)" +URL="https://github.com/pcdshub/twincat-bsd-ansible/tree/${VERSION}" + +echo "If you made changes, please update the deployment docs (https://confluence.slac.stanford.edu/x/0IsFGg)" +echo "TcBSD Ansible Version: ${VERSION}" +echo "Link commit URL: ${URL}" +echo "PLC Updated on: $(date +'%b %d, %Y')" diff --git a/scripts/provision_plc.sh b/scripts/provision_plc.sh index 6356e81..bce4699 100755 --- a/scripts/provision_plc.sh +++ b/scripts/provision_plc.sh @@ -35,3 +35,6 @@ ansible-playbook "${ANSIBLE_ROOT}/tcbsd-provision-playbook.yaml" --extra-vars "t # Stop the ssh agent if we started it here ssh_agent_helper_cleanup + +# Prompt to update deployment docs +"${THIS_DIR}"/docs_prompt.sh