mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
puppet: Only execute setup-apt-repo if necessary.
This means that in steady-state, `zulip-puppet-apply` is expected to produce no changes or commands to execute. The verification step of `setup-apt-repo` is quite fast, so this cleans up the output for very little cost.
This commit is contained in:
committed by
Tim Abbott
parent
5a22e73cc6
commit
d15e6990e5
@@ -4,6 +4,22 @@ set -e
|
||||
set -u
|
||||
set -o pipefail
|
||||
|
||||
verify=false
|
||||
args="$(getopt -o '' --long verify -- "$@")"
|
||||
eval "set -- $args"
|
||||
while true; do
|
||||
case "$1" in
|
||||
--verify)
|
||||
verify=true
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Ensure the directory for LAST_DEPENDENCIES_HASH exists
|
||||
mkdir -p /var/lib/zulip
|
||||
|
||||
@@ -21,6 +37,8 @@ LAST_DEPENDENCIES_HASH="$(cat "$DEPENDENCIES_HASH_FILE")"
|
||||
# (apt keys, code, etc.) changed.
|
||||
if [ "$DEPENDENCIES_HASH" = "$LAST_DEPENDENCIES_HASH" ]; then
|
||||
exit 0
|
||||
elif [ "$verify" == true ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that the sources file exists
|
||||
|
||||
Reference in New Issue
Block a user