Ensure to remove update information if upgraded

This commit is contained in:
Jeremy Gardais 2018-05-04 16:58:18 +02:00
parent 3dc74ad15f
commit d93818eb87
2 changed files with 3 additions and 1 deletions

View File

@ -33,7 +33,7 @@ then
touch "${JENKINS_PLUGIN_UPDATE_LOG}" touch "${JENKINS_PLUGIN_UPDATE_LOG}"
#printf '%b\n' "Please upgrade plugins" #printf '%b\n' "Please upgrade plugins"
else else
rm -f "${JENKINS_PLUGIN_UPDATE_LOG}" rm -f -- "${JENKINS_PLUGIN_UPDATE_LOG}"
#printf '%b\n' "Nothing to do" #printf '%b\n' "Nothing to do"
fi fi
cd - > /dev/null || exit cd - > /dev/null || exit

View File

@ -14,6 +14,7 @@ JENKINS_CLI_JAR="${JENKINS_HOME}/war/WEB-INF/jenkins-cli.jar"
JENKINS_AUTH_FILE="/root/.jenkins.auth" JENKINS_AUTH_FILE="/root/.jenkins.auth"
JENKINS_PLUGIN_LIST_FILE="${JENKINS_HOME}/updates/.plugin_list.$(date +%Y%m%d)" JENKINS_PLUGIN_LIST_FILE="${JENKINS_HOME}/updates/.plugin_list.$(date +%Y%m%d)"
JENKINS_PLUGIN_UPDATE_LOG="${JENKINS_HOME}/.update_plugin"
if [ ! -f "${JENKINS_CLI_JAR}" ]; then if [ ! -f "${JENKINS_CLI_JAR}" ]; then
printf '%b\n' "Jenkins-cli (${JENKINS_CLI_JAR}) does not seem to be available." printf '%b\n' "Jenkins-cli (${JENKINS_CLI_JAR}) does not seem to be available."
@ -54,5 +55,6 @@ cd - > /dev/null || exit
# Purge "log" files older than 30 days # Purge "log" files older than 30 days
find "${JENKINS_HOME}/updates" -iname ".plugin_list*" -mtime +30 -delete find "${JENKINS_HOME}/updates" -iname ".plugin_list*" -mtime +30 -delete
rm -f -- "${JENKINS_PLUGIN_UPDATE_LOG}"
exit 0 exit 0