This page lists how to use the pre-flight tool for AnthillPro.
Usage: preflight <option> preflight <command> <options> <no-command> --help show help --version show version <any-command> -v, --verbose show additional output --debug show debug output config - configure user option user <user> configure anthill user password [<password>] configure anthill password url <url> configure anthill url cert-trusted <boolean> configure anthill certificate trust local-server-host <host> configure file server host local-server-port <port> configure file server bind port build - build a project -p, --project <name|id> target project (required) -w, --workflow <name|id> target workflow (required) -i, --include <path> include path in source -x, --exclude <path> exclude path from source -I, --include-artifact <path> include path in delivered artifacts -X, --exclude-artifact <path> exclude path from delivered artifacts -D, --property <name>=<value> set workflow property value --dir <path> override working directory -O, --output <path> override output directory -l, --log <path> set preflight log file --url <url> override configured anthill url --user <username> override configured anthill user --password [<password>] override configured anthill password --local-server-host <host> set file server host --local-server-port <port> set file server port
The preflight client first starts a simple file server. The server is used to transfer source files from the user desktop to a build agent and to transfer build artifacts from the build agent to the user desktop. Next, the preflight client requests anthill to perform a build. It is expected that the build will have special preflight transfer steps already configured. One step will request source files from the preflight client that originated the build and lay them down in the workspace directory. The second step will send artifacts from the agent back to the preflight client.
The basic model for a preflight workflow is this.
Alternatively, the source checkout step could be skipped altogether and the preflight client will provide all source files.
Extract the preflight package. In the directory in creates, there are install scripts for Windows and Unix. Execute the appropriate one for your platform:
Windows> .\install Unix> ./install
You will be prompted for an install location. You will need to have appropriate permissions to write to the location you select.
Below lists the configurations for various scenarios.
When the preflight client is run for the first time, it will ask for the configuration information it needs. This information is store persistently, per user, so that will not need to be reentered.
The preflight client be explicitly configured with the "config" command. Here are some example commands to configure anthill url, user, and password:
C:\>preflight config url http://anthill.example.com/ C:\>preflight config user bob C:\>preflight config password p@ssw0rd
The password option can also prompt for a password for increased security.
In normal usage, the preflight system depends on steps added to the normal build workflow. These steps are in the Preflight folder: "Transfer Source Step" and "Transfer Artifacts Step". These steps should be added at appropriate points in your build job.
All steps, including preflight steps, have preflight flags in the "Additional Options" section of the step configuration. The first, "Run in Preflight", controls if the step is executed in a preflight build. Most steps will leave this on the default, true. The main exception would be artifact publishing steps. Artifacts from preflight builds are often not preserved on the server.
The second option, "Run in Preflight Only", controls if the step is executed only in a preflight build. Normal builds do not execute steps with set to true. By default, this option is false and most steps will use this setting. The exceptions are the two preflight steps. These should only be used in a preflight a build as the communicate with the preflight client. When configuring these steps, set "Run in Preflight Only" to true.
The preflight flags are not limited to any particular steps. This is useful, for example, for skipping packing steps not useful to a preflight user or publishing preflight artifacts to special artifact sets.
The preflight client controls what files are sent and what files are received with command line options. For sending source files, "-i" will add an include pattern and "-x" will add an exclude pattern. For receiving files, the options are similiar: "-I" will add an artifact include pattern and "-X" will add an exclude pattern (note the difference is case).
Here's a simple example:
C:\>preflight build -p petstore -w "build trunk" -i "src/**" -x "src/conf/**" -I "dist/*.war" -X "dist/util.war"
This command will run the "build trunk" workflow of the "petstore" project. All source files will be included except those in src/conf. All WAR files in dist will be returned, except for util.war.