Creating an environment by using an Ant task

You can create an environment by using the HCL® Quality Server Ant task.

Here is an example syntax:
<taskdef name="createEnvironment" classname="com.ghc.ghTester.ant.CreateEnvironment" classpathref="tasklib" />

<createEnvironment domain="<Domain name>" baseEnvironment="<Environment name>" description="<description>" 
serverUrl="https://Hostname or IP address:5443/RTCP/" nameProperty="<Property to set with the environment>" 
securityToken="<Security token>" />

The following table lists the attributes that you can use with the createEnvironment Ant task for creating an environment.

Table 1. List of available attributes
Attribute Description Required
baseEnvironment The name of the environment to be used as the base of the created environment. Yes
domain Domain name Yes
nameProperty The property to set for the created environment.
The following properties can be set:
haltOnFailure
When set as true, it fails the ant script if the environment is not created.
failureProperty
Property to set as true if the environment is not created.
No
securityToken The value of the security token to use for authentication with HCL® Quality Server when domain security is enabled. For more information, see Domain level security. No
serverUrl URL of the HCL® Quality Server Yes
Note: All environment creation events are recorded in the HCL® Quality Server Audit log. (For information about this log, refer to Administration of HCL Quality Server.)

Error codes

For details of any error codes, see Exit codes for Command-line client and Ant client.