Here’s a portable bash script to disable the nonessential plugins we turned off (mercurial, theme-manager, dark-theme, pipeline-graph-view) on any Jenkins host:
#!/usr/bin/env bash
set -euo pipefail
JENKINS_HOME="${JENKINS_HOME:-/var/lib/jenkins}"
PLUGINS_DIR="${JENKINS_HOME}/plugins"
PLUGINS=("mercurial" "theme-manager" "dark-theme" "pipeline-graph-view")
echo "JENKINS_HOME: $JENKINS_HOME"
echo "Disabling: ${PLUGINS[*]}"
for p in "${PLUGINS[@]}"; do
for ext in jpi hpi; do
if [[ -f "${PLUGINS_DIR}/${p}.${ext}" ]]; then
sudo touch "${PLUGINS_DIR}/${p}.${ext}.disabled"
echo " - ${p}.${ext} -> disabled"
fi
done
done
echo "Restarting Jenkins..."
sudo systemctl restart jenkins
echo "Done. Check status with: sudo systemctl status jenkins"
No comments:
Post a Comment