Deploying with Ant

Tynamo™ can be deployed to your SNAP using Ant. A target called deploy in the build script is provided for this purpose. Simply execute Ant as you would normally, but add the string "deploy" on the command line. Also remember to fill in the appropriate values in the deploy.properties file.

Tynamo™ can also be started using the startserver target. This will execute a specifiable startup command via Telnet.

Setup

First, in order to provide the required FTP and Telnet support, Ant needs either the NetComponents.jar or Jakarta Commons/Net library, depending on the version of Ant: NetComponents is required for Ant versions 1.5.4 and earler, and the Jakarta Commons/Net library is required for Ant versions 1.6.0 and later.

This library must be copied into Ant's lib/ directory. For those not using the default Ant execution script, this JAR file must be added manually somehow to the CLASSPATH before Ant is executed.

Transfer

The deploy script will first check for the existence of the FTP library, and display a message if it is not found. If it is found, then the build is deployed to the SNAP according to the following structure.

If the transfer doesn't work, then try setting the FTP client to passive mode by changing passive="no" to passive="yes" in all the <ftp> tags in your build.xml file.

Structure

The script will first try to create the deploy root directory, and then a logs/ directory below this.

Next, all the files below snap/ on the local disk, and any JAR specified by target.jar in the build process, will be transferred to the appropriate place under <deploy.rootdir> on the SNAP.

Starting the Server

The startup script will connect to the deployment server via Telnet using its own userid and password, and then execute a single, specifiable command.

Remember that it is also possible to start the server from the startup script in Ish.

The deploy.properties File

The deploy.properties file is used to control the deploy and startup processes. There are four properties that describe how the build is to be transferred, and three that help describe how to start the server.

Property Name Description
deploy.server The address of the SNAP. The FTP server must be running.
deploy.userid The FTP client will log in with this username. If there is a root directory with this name on the SNAP to which this user has access, then the FTP client will start with this as its current directory. (Actually, this fact depends on which version of the SNAP firmware you have. For example, 0.10.0 doesn't have this.)
deploy.password The FTP client will use this as the password when logging in.
deploy.rootdir All transfers will be relative to the directory specified here. If this is the same as the default user directory, then it should be the string ".".
startserver.userid The Telnet client will log in with this username. The webserver will be started under this user.
startserver.password The Telnet client will use this as the login password.
startserver.command The startup script will wait for a ">" character, execute this command, wait for another ">" character, and then exit the session. It is a good idea for the command to execute as a background process.

For example, the supplied WebServer script starts the server as a background process: this is what's executed in the default deploy.properties file.