choff
Returning Observer

Post-processing war files with Generic Webserver

Hello all,

We would like to change the permissions of the war files that FirstSpirit creates when it deploys web apps / components to a web server. The changes should apply immediately after FirstSpirit creates the war files.

From Documentation for Administrators - Web server​​, we think that that should be possible by configuring a webserver of type "Generic" in the FirstSpirit ServerManager and placing a Beanshell script in the field "Installation".

When we looked at this approach in detail, a few questions came up:

1) In which situation exactly is the script called?

2) What is the scripts supposed to do?

3) Where can the script get further details from, regarding the web app / component that it is supposed to install?

After some experiments, we think that the answer for questions 1) and 2) is

- the script is called whenever the war file of a web app / component has been created in the exports subdirectory of the FirstSpirit server and

- the script is supposed to "deploy" this war file to the web server.

However regarding question 3) we have no clue. We do not even know whether it is possible at all for the script to find out which web app / component is to be deployed. We have searched the developer API and access API for answers but without success.

What we would at least need to know is the name of the currently created war file so that our script can change the permission (and copy it to the web server's webapps directory).

Without knowing the name we can only implement a dirty solution. For example the script could look at the export directory and search for the file that has been changed most recently, assuming that this is the file that needs to be installed on the webserver.

So our main questions is: how can the installation script of a Generic webserver configuration get the name of the war file that it should install?

We would also appreciate any hints on further documentation or examples that answers the questions 1)-3) above in more detail (and also for the "Deinstallation" and "Installation status" scripts).

Best regards,

Christian

0 Kudos
0 Replies