sivaprasad9394
Occasional Collector

To install Modules to FirstSpirit automatically?

Jump to solution

Hello,

Is it possible to install FS modules to server via command line input of source path and destination path?

Like to createa jar file with command line input of source path and destination path.By executiong this command modules will be installed to different server.

Thank you

1 Solution

Accepted Solutions

Hi Siva,

I think that the behavior is as described in the documentation.

So if you try to install an invalid module file (e.g. an invalid module descriptor) the previous installed version of the module will not be restored. I don’t have tried it yet but I would trust the documentation.

If you want to be sure just try it on your local development environment. 😉

Greetings

Sandro

View solution in original post

0 Kudos
8 Replies
bIT_sosswald
Returning Responder

Hi Siva,

you can take a look at the class "ModuleAdminAgent" of the Developer-API.

It has a method install(InputStream fsmStream, boolean updateUsages) and some other methods that should help you to accomplish your task.

Greeting

Sandro

0 Kudos

Hi Siva,

you can extend the OpenSource FS-CLI tool to do that via ModuleAdminAgent as Sandro sugguested:

https://github.com/e-Spirit/FSDevTools

Regards,

Marian

HI Sandro,

Thank you for your reply.I have verified the interface and implemented it via simple java program.

ModuleAdminAgent adminAgent = conn.getBroker().requestSpecialist(ModuleAdminAgent.TYPE);

            FileInputStream inputStream = new FileInputStream(fileLocation);

            ModuleAdminAgent.ModuleResult result = adminAgent.install(inputStream, true);

            String status = result.getLogMessages(); 

This is working fine and Services are stopped and restarted automatically.

But in the FS-Developer API there is method name called....

@NotNull

ModuleAdminAgent.ModuleResult install(InputStream fsmStream,                                           boolean updateUsages)

                                      throws IOException,

                                             ModuleException

Important:

  • If the given fsm couldn't be loaded or activated (e.g. due to an invalid module file), the old version won't be restored!
  • The given fsmStream will be closed, automatically. The caller is not responsible for closing the stream.

My Qusetion is:

Suppose if i would have created a problamatic module and installed in the Server Manager.

Now old xxxx.fsm will be deleted in the server and newly created module yyyy.fsm will be loaded.

xxxx.fsm will not be restored right???

Scenario:

One developer is deploying the module with out taking the maven update from SVN,Also another developer is working on the same module with different java file.This leads to yyyy.fsm(problamatic fsm module.)

Thank you.

Have a nice day!.

Siva

0 Kudos

Hi Zaplatynski,

Thank you for your reply.

After analysing the tool in Git Repo....

To my understanding the tool FSDev Tool-master is used to install Store element from Source Repo(TFS,GIT,SVN anything) to first spirit system automatically by using cli inputs. Not evaluated fully.

For we have to install FS modules from (TFS,GIT,SVN anything) to our FS server automatically- for this command line arguments plain java programming should be ok for us.

Regards,

Siva

0 Kudos

Well,

since the tool is on GitHub and free, you can extend it to your needs. So take Sandro's hint and implement a command for the tool to install a module. A CLI can be intregrated nearly anyhere (IDE, build servers, ...).

Regards

Marian

0 Kudos

Hi Siva,

I think that the behavior is as described in the documentation.

So if you try to install an invalid module file (e.g. an invalid module descriptor) the previous installed version of the module will not be restored. I don’t have tried it yet but I would trust the documentation.

If you want to be sure just try it on your local development environment. 😉

Greetings

Sandro

0 Kudos

Hi Sandro,

Thank you for your reply.May be i will try in my local with problamatic fsm module and verifiy the log informations.

In the above case old fsm module will not get restored.

  • Suppose if i do Read the module and writting it into tmp folder and FS file system i am deleting the old one(which is copied to tmp dir) and writting the new fsm module there.
  • While doing the operaton only i came to know there is a problem in module which is currently installing in the system.
  • Now module is failed to install and fis stream also got closed here.
  • Now i can't read the file in tmp dir and write it to the FS File system location for module.Fis is already closed.

So is there any other solution for this to over come the problem.?

Thank you.

regards,

Siva

0 Kudos

Hello,

Alreay discussed with Mr.Vogel from e-spirit.This is the common behaviour only.

First need to test in Development machine.If it works there same will work for Quality machine and Production system.

Error occurences changes are from module.xml file and other external jar file.If Development machine cmd lline installation is succuss,then same will be happen in Quality and Production machine.

Thank you.

Regards,

Siva

0 Kudos