-d flag removes contents of already existing directory, though does not say in README
See original GitHub issueUsing the -d
or --plugin-download-directory
will remove the directory/contents specified with the flag, even if there are contents there. This is not reflected in the README:
--plugin-download-directory or -d: (optional) Path to the directory in which to install plugins, which can also be set via
the PLUGIN_DIR environment variable. Directory will be created if it does not exist. If no directory is entered, directory
will default to C:\ProgramData\Jenkins\Reference\Plugins if detected OS is Windows, or /usr/share/jenkins/ref/plugins
otherwise.
I don’t believe this should be the default behavior. There should be at least a warning letting the user know that it whatever is there will be removed or that location already exists. I just found this out the hard way as I pointed -d
to my current plugins folder which caused the removal of all of my plugins, and now Jenkins wants to uninstall them on next reboot since they’re missing.
Please feel free to correct me if I have something wrong.
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
command-line-fundamentals/README.md at master - GitHub
The mkdir command is used to create a specified folder. If the specified folder already exists, it will not be overwritten. Moving and...
Read more >How do I add an empty directory to a Git repository?
A simple solution to the "hidden problematic" is to name the file gitkeep (without the leading dot). We can take this one step...
Read more >init/README.md
This approach ensures that the only service entries that init reads and the only actions that init performs correspond to services whose binaries...
Read more >2.2 Git Basics - Recording Changes to the Repository
Let's change a file that was already tracked. · The CONTRIBUTING.md file appears under a section named “Changes not staged for commit” —...
Read more >Working With Files and Directories – The Unix Shell
This happens because rm by default only works on files, not directories. rm can remove a directory and all its contents if we...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This was a quick fix to an issue we had with failed plugin downloads never being cleared up.
The proper fix would either be:
IMHO the directory should be deleted so that it contains only the plugins listed in the YAML file (and the resulting dependency tree).
Otherwise plugin-installation-manager-tool cannot be used in IasC to uninstall plugins when they are removed from config, it can only ever add new plugins, leaving unlisted ones installed forever.
Also I would DL them all to tmp, and only move them when the entire list is successful - i.e. the entire operation is atomically successful or atomically fails.