Nov 4, 2017

Deploy an Application to GlassFish/Payara from command line

Deploying an application can be quite complicated depending on your environment set up. Deploying an application with the CLI can be significantly quicker than deploying it by the admin console.

To deploy an application to the default instance (server, where the admin console is installed), simply enter the following:
./asadmin deploy $path_to_war
Once you have your GlassFish environment set up, you're not likely to be deploying to the default server instance, so the target option will likely be of use to you, as it specifies where your deployment will be deployed to. With this option, you can specify that the component be deployed to a standalone instance, a cluster, or a domain.
./asadmin deploy --target cluster1 testyWar
./asadmin deploy --target instance1 testyWar