7d6322ae08
A diskimage-builder patch [1] broke our amphora-agent element by uninstalling git prior to the post-install.d phase. A followup patch in Octavia [2] changed how we get the git reference to awking an git internal log file. This seems fragile to me, so I am proposing this alternative. This patch updates our element to finish using git before the install.d phase is complete. [1] https://review.opendev.org/745678 [2] https://review.opendev.org/745683 Change-Id: I9a346b626f852171ec00d2868ccb6f98b1fb8994
27 lines
472 B
Bash
Executable File
27 lines
472 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
[ "${DIB_INSTALLTYPE_amphora_agent:-}" = "package" ] && exit 0
|
|
|
|
rm -rf /opt/amphora-agent
|
|
|
|
case $DISTRO_NAME in
|
|
ubuntu | debian )
|
|
apt-get --assume-yes purge --auto-remove
|
|
;;
|
|
fedora | centos* | rhel* )
|
|
YUM=${YUM:-yum}
|
|
${YUM} -v -y autoremove
|
|
;;
|
|
*)
|
|
echo "ERROR: Unsupported distribution $DISTRO_NAME"
|
|
exit 1
|
|
;;
|
|
esac
|