diff --git a/scripts/upgrade b/scripts/upgrade index 78799f1..bb32670 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -162,6 +162,20 @@ ynh_script_progression --message="Upgrading jenkins-cli.phar..." wget -nv --no-check-certificate https://$domain$path_url/jnlpJars/jenkins-cli.jar -O /var/lib/jenkins/jenkins-cli.jar +#================================================= +# UPGRADE PLUGINS +#================================================= +ynh_script_progression --message="Upgrading plugins..." --weight=40 + +jenkins_cli="ynh_exec_warn_less java -jar /var/lib/jenkins/jenkins-cli.jar -s http://${domain}:${port}${path_url}" +UPDATE_LIST=$($jenkins_cli list-plugins | grep -e ')$' | awk '{ print $1 }' ) + +if [ -n "${UPDATE_LIST}" ]; then + $jenkins_cli install-plugin "${UPDATE_LIST}" +fi + +ynh_systemd_action --action=restart --line_match="Jenkins is fully up and running" --log_path="/var/log/$app/$app.log" --timeout="3600" + #================================================= # DEACTIVE MAINTENANCE MODE #=================================================