jetty-project / jetty-remote-deployer

A webapp to allow for Remote Deployment of other webapps
1 stars 1 forks source link

Jetty Remote Deployer WebApp

This project provides a WAR file that provides HTTP resource endpoints to deploy and undeploy other WebApps.

HTTP Resource Endpoints:

Resource /deploy

Method GET will deploy the referenced war file (found on the server) to the running instance of Jetty.

Method PUT will perform a remote deploy of the provided war to the running instance of Jetty.

Resource /undeploy

Method GET will undeploy the provided context-path

Installation

There is a provided jetty.base config overlay that you will need if using the modern jetty-home standalone (or the older jetty-distribution standalone).

$ ls remote-webapp/target/*.jar
remote-webapp/target/jetty-remote-webapp-0.1-SNAPSHOT-config.jar

The process goes like this ...

$ cd /path/to/myjettybase
$ jar -xf /path/to/jetty-remote-webapp-0.1-SNAPSHOT-config.jar 
$ java -jar /path/to/jetty-home-9.4.27.v20200227/start.jar --add-to-start=deploy-remote
INFO  : deploy-remote   initialized in ${jetty.base}/start.d/deploy-remote.ini
INFO  : webapp          transitively enabled, ini template available with --add-to-start=webapp
INFO  : security        transitively enabled
INFO  : servlet         transitively enabled
INFO  : deploy          transitively enabled, ini template available with --add-to-start=deploy
MKDIR : ${jetty.base}/remote-webapps
INFO  : Base directory was modified

Check the results with --list-config

$ cd /path/to/myjettybase
$ java -jar /path/to/jetty-home-9.4.27.v20200227/start.jar --list-config

...(snip)...

Jetty Server Classpath:
-----------------------
Version Information on 12 entries in the classpath.
Note: order presented here is how they would appear on the classpath.
      changes to the --module=name command line options will be reflected here.
 0:                    3.1.0 | ${jetty.home}/lib/servlet-api-3.1.jar
 1:                 3.1.0.M0 | ${jetty.home}/lib/jetty-schemas-3.1.jar
 2:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-http-9.4.27.v20200227.jar
 3:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-server-9.4.27.v20200227.jar
 4:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-xml-9.4.27.v20200227.jar
 5:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-util-9.4.27.v20200227.jar
 6:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-io-9.4.27.v20200227.jar
 7:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-security-9.4.27.v20200227.jar
 8:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-servlet-9.4.27.v20200227.jar
 9:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-webapp-9.4.27.v20200227.jar
10:         9.4.27.v20200227 | ${jetty.home}/lib/jetty-deploy-9.4.27.v20200227.jar
11:             0.1-SNAPSHOT | ${jetty.base}/lib/jetty-remote-deploymentmanager-0.1-SNAPSHOT.jar

Jetty Active XMLs:
------------------
 ${jetty.home}/etc/jetty-bytebufferpool.xml
 ${jetty.home}/etc/jetty-threadpool.xml
 ${jetty.home}/etc/jetty.xml
 ${jetty.home}/etc/jetty-webapp.xml
 ${jetty.home}/etc/jetty-deploy.xml
 ${jetty.base}/etc/jetty-deploy-remote.xml
 ${jetty.home}/etc/jetty-http.xml

The existence of the following entries are important:

Other important files / directories: