This topic covers all of the tasks required to create a source
code adaptor, connect it to a project with an adaptor link, and run
the adaptor-linked project in test mode.
Creating an adaptor by selecting a template
To
create an adaptor by selecting a template:
- Select
- Click Add Adaptor.
- At Name, enter a unique name for the adaptor. The adaptor name
must be unique across the entire set of adaptors and cannot contain
spaces.
- At Type, select the adaptor type.
- At Template, select the template. The list contains the adaptor
templates installed with the Build Forge product. ClearCase and ClearQuest
adaptors do not require a separate license key. Other adaptors are
separately licensed through the Adaptor Toolkit.
- At Access, select an access group. The ability to view or edit
the adaptor is restricted to these group members.
- Click Save Adaptor.
Creating an empty environment
To create
an empty environment:
- Select
- Click Add Environment.
- At Name, enter the environment name. Assign a name that describes
the purpose of the environment.
- At Access, select an access group. The ability to view or edit
the environment is restricted to these group members.
- Click Save Environment.
Adding adaptors to projects
To add the
adaptor to a project:
- Select
- Click Add Adaptor Link.
- At Adaptor, select the adaptor (and adaptor template) that you
created.
- At Project, select the project. The list displays the projects
that are not already linked to an adaptor.
- At State, select Active.
- At Environment, select the empty environment that you created
for the adaptor link.
- At Populate Environment, select Yes. The application environment
variables in the adaptor template are added to the environment.
- Click Save to link the adaptor to the project. The adaptor
and the project are added to the list of adaptor links.
Editing environment variables
To edit environment
variables:
- Select
- For the environment you created, click the Edit icon
. The panel displays the adaptor environment
variables automatically added to the environment.
- Review the default values for the environment variables provided
by the adaptor template.
- Change the default values for your source code application as
necessary to run the adaptor project.
Condition attribute
The condition attribute
allows conditions to be applied to some adaptor properties using Perl
comparison operators. String literals, numbers, or variables can be
used for the comparison.
The syntax for the condition attribute
is:
condition="true(<lvalue> <operator> <rvalue>)"
condition="false(<lvalue> <operator> <rvalue>)"
condition="hastext(variable)"
condition="isempty(variable)"
Specify one of four types:
Type |
Description |
true |
Evaluation succeeds if lvalue and rvalue are equal. |
false |
Evaluation succeeds if lvalue and rvalue are not
equal. |
hastext |
Evaluation succeeds if the value
length is greater than 0. |
isempty |
Evaluation succeeds if the value
length is 0. |
The lvalue and rvalue can be strings, numbers, or variables
containing strings or numbers. The condition operator is any Perl
compatible condition operator. There are string and number condition
operators. You must use the appropriate operator, or you will receive
unpredictable results.
String Operators |
Numeric Operators |
eq |
== |
ne |
!= |
gt |
> |
lt |
< |
ge |
>= |
le |
<= |
Using numeric operators with strings will not return
correct results, and the same holds true for using string comparison
operators on numeric values.
For example: condition="true("PASS"=="FAIL")
The
above condition will always return true, which is incorrect.
Examples
of conditions:
- condition="true($BF_SERVER eq "TEST_BOX") - Runs the item only
if the build server variable contains TEST_BOX.
- condition="false($BF_BID <=141) - Runs the build only if the
build tag is greater than 141 or not less than 141.
Adaptor properties that support conditions:
Double check the DTD for your current install of Build Forge
for up to date information on which properties support the condition
attribute.
You will see an entry similar to the following
for properties supporting conditions:
<!ATTLIST
adduser condition CDATA #IMPLIED>
The adaptor DTD is
located in %BF_HOME%\interface for Windows and $BF_HOME/Platform/interface
for UNIX as the file interface.dtd.
Running adaptors in test mode
To run the
adaptor in test mode:
- Select
- In the list of system configuration parameters, select Link
Debug Mode.
- At Link Debug Mode, select Yes.
- Click Save.
- Select
- In the list of projects, select the adaptor-linked project you
created from the Start Project page.
- Click Execute.
View job status and logs
To view the job status
and log information for the adaptor project:
- Open Jobs.
- In the list of projects, locate the adaptor-linked project to
view job pass/fail status.
- To view job logs:
- Select the Tag Name for the adaptor project to access job log
information.
- Select the Bill of Materials to access the BOM report.