-
-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
semi-delayed restart after plug-in installs #574
Comments
Yes, this is really a bit annoying. You can find my way around it here, which is to write down all the plugin name/version combinations into a file on the Jenkins master and trigger a restart if that file changes. |
@StephenKing - Thanks that's a lot cleaner than what I was trying to do. Yeah, there almost needs to be a separate resource to handle all the plug-ins as a whole, then restart. |
I do it like so:
@chazzly you never ever should use a global var. |
@StephenKing, with your method of plugin installation, have you met the following situation? After
Either some waiting time is needed or |
Cookbook version
4.2.1
Chef-client version
12.18.31
Platform Details
Oracle Linux Server release 7.2
Expected Result:
Install / update plug-ins, restart jenkins, continue chef run and and configuration.
This is more of a question than an issue. I'm hoping there's a better approach than what I'm doing. I have read through the documentation in this repo and a number of past/present issue, but I'm not seeing what I'm after. In my jenkins wrapper cookbook, I go through the list of plug-ins to be installed:
In some cases, these plugins must be installed and active for later config changes to work, so jenkins needs to be restarted. I could, of course, add a notify to restart jenkins immediately, but that means jenkins would get restarted with each and every plug-in, which could be dozens, especially on initial install. So, I'm trying to use a global variable as a flag, a ruby block to update that flag if (and only if) any of the plug-ins are installed, then test for that flag and do an immediate service restart:
the "only_if" for the restart ruby_block needs to be lazy because, the ruby_block to update $updt only fires after the notification during execution phase.
Unfortunately, it doesn't work.
The immediate restart block runs every chef run, even if no plug-ins are install / updated. I've tried digging in to it with my tests, but can't seem to accurately test/stub the lazy variable. Anyone know what I'm doing wrong? Any better way to go about this?
The text was updated successfully, but these errors were encountered: