Skip to content

Instantly share code, notes, and snippets.

@kmcquade
Last active May 29, 2019 17:39
Show Gist options
  • Save kmcquade/b91739755d5cd0f478ee4b489942592d to your computer and use it in GitHub Desktop.
Save kmcquade/b91739755d5cd0f478ee4b489942592d to your computer and use it in GitHub Desktop.
Remove plugins from pre-baked Jenkins docker image
#!/usr/bin/env bash
set -x
#JENKINS_PLUGINS_PATH="${JENKINS_PLUGINS_PATH:-/usr/share/jenkins/ref/plugins}"
JENKINS_PLUGINS_PATH="${JENKINS_PLUGINS_PATH:-/usr/share/jenkins/ref/plugins}"
REMOVE_PLUGINS_LIST_PATH="${REMOVE_PLUGINS_LIST_PATH:-/usr/share/jenkins/ref/remove_plugins_list.txt}"
echo $JENKINS_PLUGINS_PATH
echo $REMOVE_PLUGINS_LIST_PATH
for line in `cat ${REMOVE_PLUGINS_LIST_PATH}`
do
echo "$line"
find ${JENKINS_PLUGINS_PATH}/ -name ${line}\* | xargs rm -rf
done
# testing locally:
# JENKINS_PLUGINS_PATH=./test REMOVE_PLUGINS_LIST_PATH=./remove_plugins_list.txt ./remove_plugins.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment