Issue
Is there a way to uninstall a plugin via a Cluster Operation?
I see:
* Disable plugin
* Enable plugin
* Install plugin
But no “Uninstall plugin” step.
Environment
- CloudBees CI (CloudBees Core) on modern cloud platforms - Operations Center
- CloudBees CI (CloudBees Core) on traditional platforms - Operations Center
- CloudBees Jenkins Enterprise - Operations Center
- CloudBees Jenkins Platform - Operations Center
- Cluster Operations
Resolution
First, you will need to find the plugin id on the master. You can use the following script in the Script Console to do that:
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println (" Display Name: ${plugin.getDisplayName()}, Plugin Id: ${plugin.getShortName()}")
}
return
To uninstall the plugin, you can use the following script in a Cluster Operation:
String pluginId = "mock-security-realm"
def plugin = Jenkins.getInstance().getPluginManager().getPlugin(pluginId)
plugin.doDoUninstall()
In the above example, the plugin mock-security-realm
is to be uninstalled.
This will result in an Uninstallation pending status for the plugin. The plugin will be removed completely after the master is next restarted.
0 Comments