Updates
I am going to propose a Capabilities Provider here as an update to my post. If you need more details please let me know.
We currently have a bunch of shipped Capabilities Providers in the agent source code:
- Agent
- Environment
- Nix
- PowerShell
What is being proposed is one additional Provider named ExecutableCapabilitiesProvider
.
This new ExecutableCapabilitiesProvider will probably have a config file which can be edited on the agent machine. The format of this file could probably be:
#name,executable
pip,pip3 freeze
xyz,/usr/bin/xyz-runner
abc,sh -C "ls -l /blah/blah"
As the maintainer of the self-hosted pool, I would configure this file with entries suiting me and have the agent run it as it starts. This way I am not hard-coding any values for my capabilities but rather those be determined at the start up.
And I would go one step further and add a new API call to add capabilities which is more flexible than the current one asking for name/values. An example, would be to change the parameters to Name, Provider, Params
:
efg, NixProvider, /path/to/file/efg
klm, ExecutableCapabilitiesProvider, /usr/bin/klm -a -b -c
Original Post
I'd like to make my agents report on new capabilities which are not static but rather result of a command or something similar? How can I do that?
Our agents run on linux boxes.
To be specific, I'd like to have a new capability called pip-packages
and the value for that is the result of the command pip freeze
executed on the shell.