Open Jinkxed opened 8 years ago
Hi there and thanks for using the gem.
Sorry, but this may be a dumb question ... but is the example you are using above EXACTLY what you are typing in?
If so, the problem is the brackets. Try it this way:
rundeck run --project ExampleProject --job manage-applications --options Environment=staging,Product=product1,Role=role1 --report all
The brackets are just in the help and such to say "these are optional".
I tried just about every variation I could come up with.
rundeck run --project ExampleProject --job application-status --options Environment=staging,Product=product1,Role=role1 --report all
Job options were not valid: Option [Environment, staging,Product, [production, qa, staging]] value: {1} was not in the allowed values: {2}Option 'Product' is required.Option 'Role' is required.
Also the output of the logs only shows the execution of the job, it doesn't show the actual output from rundeck.
Example:
Execution 56 is running. Average job duration is 1.814 seconds.
Doesn't show the log output as shown in rundeck after.
I have a feeling both of these issues are related?
Thanks for looking into it!
Oh also I did notice slack likes to convert -- into a single double dash. Maybe this has something to do with it?
Nevermind tried copy and pasting into a ide to remove the single double dash. Didn't make a difference.
I would bet, almost certainly, that the conversion of the double dash has something to do with it.
I also noticed in that last example that there's a space in the --outputs value ... that will DEFINITELY screw things up.
As some background, I'm using the keywords extension in this to get those values. While options looks like a list, it's actually just string that I then parse and submit to Rundeck as params. Thus, it will HAVE to be --options Something=With,No=Spaces
.
Let me know if taking the space out of the one above (and convince Slack to keep the double-dash) has an impact.
Tried both still does the same thing. :(
I updated the example above to be with no spaces and the output.
So figured this out.
Looks like it has to be bar separated
rundeck run --project ExampleProject --job application-status --options Environment=staging|Product=product1|Role=role1 --report all
Reason is this I think?: https://github.com/harlanbarnes/lita-rundeck/blob/master/lib/lita/handlers/rundeck.rb#L266
Okay, so it looks like it is not splitting the first value in the option key/value pair on the comma.
And now that I look at it, it's a bug. The delimiter in the code is a pipe, not a comma ... yet all the help and the docs say comma. And of course, all tests are "single option" (and that was only how I used it up until this point.) Brilliant.
Thus, the short term workaround is to change to this:
--options Environment=staging|Product=product1|Role=role1
and I'll try to patch and release today.
Sorry about all that.
bar separated works fine for me if you want to leave it this way. Just would need to update docs?
Thanks for the help!
Yeah, you found it too! Again, sorry about that.
I'll just add in comma-delimited too. It A) shouldn't be that hard to do B) is more flexible and C) I need to update the tests for multi-options anyway.
Thanks for finding this!
No problem at all, this is an awesome gem and I have lots of use cases for it. So very much appreciate you writing it!
Moving to new feature!
Right. I'm almost positive that's because the "alias" feature only aliases the project+job. Spin up a new ticket for this and I'll figure out how to alias the options as well.
Hiyas!
Thanks so much for writing this gem, I have a lot of plans for it and I hope you are still maintaining it.
However I did run into an issue.
If I try to run a job that I have set options in that are required. None of them seem to get passed?
Example and logs:
Job options were not valid: Option 'Environment' is required.Option 'Product' is required.Option 'Role' is required.
In the logs I see:
Which is where I'm setting the filtered nodes.
Please let me know if I can supply you with anything else, I'd love to get this working so I don't have to have single parameter jobs in Rundeck to work with this.
Thanks!