0

I'm writing a bash script that pulls a specific copy of our java web application from the svn repository and builds it.

I would like that script to be able to deploy the generated .war file on the glassfish server.

The script and glassfish server are on the same machine. The script has access to the glassfish folder containing the "asadmin" utility.

The problem: asadmin asks for a password (I can specify the user name with a "--user" parameter). I'm not sure if it's possible to specify the password through a "--password" parameter, but for obvious reasons, that's not an option on a production server.

Is there some way to automate this deployment process anyway? Setting an empty password for the admin might be an option, but I can only accept it if it is possible to disable the "admin" user in the control panel (accessible by multiple users).

I also thought of simply copying the generated classes to the glassfish/domains/ourdomain/applications/ourapplication/ folder. However, I doubt this is the correct way to perform a deployment. Moreover, the application does not get reloaded that way, and users are still seeing an old version of the application!

--

Thank you for the suggestions!

4
  • Why is it not an option to use a --password parameter?
    – raphink
    Jun 20, 2012 at 22:52
  • Thanks for your comment. Using --password would mean I have to store the password nonencrypted in the script. Even if non-admins are not supposed to be able to see the script, we want that extra layer of security by not exposing a glassfish admin password. Storing plain-text passwords is commonly avoided after all, not just on application servers.
    – Eti
    Jun 20, 2012 at 23:21
  • If you used a configuration management system (such as Puppet for example), you would store the password on your configuration server instead of storing it in a local script...
    – raphink
    Jun 21, 2012 at 13:19
  • Thanks for the info. That would still store it unencrypted or in a way that it can easily be decrypted, which is exactly what we want to avoid. I finally found a way to do what I needed without storing the password in any way, which is preferable.
    – Eti
    Jun 24, 2012 at 21:55

1 Answer 1

0

While crawling blogs trying to find out how to store the passwords in a keystore and load them automatically, I eventually discovered the use of the glassfish/domains/ourdomain/autodeploy/ directory:

Turns out you can simply copy the .war file to that folder, and it'll be picked up and deployed automatically by glassfish on the first request!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .