Hi,
In your command implementation, you can inject a Session object that can
execute Karaf commands.
See [0].
Regards,
Vincent.
[ 0 ] :
https://github.com/roboconf/roboconf-platform/blob/master/karaf/roboconf-karaf-commands-dm/src/main/java/net/roboconf/karaf/commands/dm/targets/InstallTargetCommand.java
Le 25/01/2017 à 18:49, Nicolas Brasey a écrit :
Hi,
For our internal integration and regression tests tooling / devops,
I'm thinking of writting some code running inside karaf to be able to
support some kind of business profiles management (btw: nothing to do
with Karaf profiles here).
Our application is entirely configurable using karaf commands, I'm
talking about business configuration, not infrastructure or port
configuration. At the moment, we build simple text files that contains
a list of commands to be able to configure an empty system that we
execute with the client script. This is really convenient for us, as
we can switch from a configuration to another by simply executing the
text file corresponding to the specific customer and be able to test
the application and its context. But at the moment, it has some issues
because we need to manually copy that file to the target server, adapt
some path, and run the client script. It is good but not great, as
it's not automation friendly.
I'm thinking of a better solution where we would store those profiles
in a profile repository (let say an http server for now...). Assuming
that I can download that text file, I need now to be able to execute
it as the client script would do, but without the ssh communication as
I'm running inside karaf already. That is where I'm stuck at the
moment. I have been browsing the source code of Karaf, but I don't
find the place or service I need to use to be able to execute this
list of commands.
Could someone give me a hint or pointer where I should look at ?
Thanks a lot for your help!
Nicolas
--
Vincent Zurczak
Linagora: www.linagora.com <http://www.linagora.com/>
Twitter <https://twitter.com/VincentZurczak> Vincent Zurczak @ LinkedIn
<http://fr.linkedin.com/pub/vincent-zurczak/18/b35/6a7> My Skype ID
<callto://vincent.zurczak> My English blog <http://vzurczak.wordpress.com>