<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Codestation for Developers

Codestation for Developers

Codestation is the name of AnthillPro's artifact repository management and access tool set. It provides support for dependencies of third-party tool kits and software libraries. Codestation is also responsible for bringing the dependency management lookup and retrieval utilities to the individual developer.

AnthillPro provides a number of Ant tasks and a command-line interface for developers. The tools, and full documentation, are available by following the tools link:

There are also a number of advanced settings and features, outlined below, to change Codestation's behaviour. For most users, the default settings should suffice.

Codestation, Artifact Sets, and Exclusive Locks

When uploading artifacts to a Build Life, Codestation exclusively locks the Build Life for the duration of the process. Once the upload begins, all other requests (from other workflows, etc.) to upload artifacts to the locked Build Life must wait for the lock to release before the subsequent upload begins.

Under certain conditions Codestation may throw the following error: Server Error: HTTP Code 500: Could not acquire exclusive access to the buildlife. If you see this error when Codestation is attempting to upload multiple artifacts to the same Build Life, the first upload most likely exceeds the 15-second default time-out. To address this issue, increase the time-out setting. For example, if the longest upload takes 30 seconds, the time-out setting must be greater than 30 seconds, otherwise Codestation will throw an error. To reset the Codestation time-out:

  1. Shut down the AnthillPro server.

  2. Open the server's bin/ah3server (UNIX) or bin/ah3server.cmd (Windows) file in a text editor.

  3. Add the following to JAVA_OPTS (under BEGIN INSTALL MODIFICATIONS):

    -DCodestationRepositoryFileHelperServer.tryLockTimeoutSeconds=

    After the equals sign (=), give the time, in seconds, that Codestation should wait before timing out. For example, input =60 to have Codestation wait one minute before timing out.

  4. If AnthillPro is running as a Windows service, repeat Item 3 in the bin/service/ah3server.cmd file.

    Once modified, the Server must be re-installed as a Windows Service. See Manually Install the AnthillPro Server as Windows Service.

  5. Restart the AnthillPro server.

Codestation Artifact Time-to-live

Use the Codestation Time-to-live feature to determine how long unused artifacts remain in the cache. By default, every time the cache is accessed, artifacts that have been unused for 3 days will be automatically removed.

The Time-to-live option can be configured either in the codestation.properties file, or as an agent property. For both configurations, the value equals the number of days unused artifacts are to be stored in the cache. For example, in the codestation.properties file, codestation.cache.timeToLive=10 will delete unused artifacts after 10 days.

For the codestation.properties file:

  1. Open the codestation.properties file (located in the user home directory).

  2. Configure with the property codestation.cache.timeToLive.

    If the property is not set (or is set to zero), unused artifacts will be removed after 3 days. To never delete the artifacts, set the property to a negative number.

    Example properties file:

    codestation.server=https://anthillserver.company.com
    codestation.user=build
    codestation.password=buildpass
    codestation.noCheckCertificate=false

For the Agent (you must have administrative permissions to the agent):

  1. Go to AnthillPro UI > Agents > Agent and select the appropriate agent from the list.

  2. Select the Agent Properties tab and create a new property.

  3. Give the property name and value in the name=value format (e.g., codestation.cache.timeToLive=10).

    If the property is not set (or is set to zero), unused artifacts will be removed after 3 days. To never delete the artifacts, set the property to a negative number.

  4. Name. Same name as the property (codestation.cache.timeToLive).

  5. Value. The path of the cache directory.

Codestation BOM Suppression

Normally a Codestation resolve creates BOM files that describe what artifacts were part of the resolve so that they can be cleaned up for the next resolve. In scenarios where the cleanup is never performed, the BOM files are unnecessary. If using the BOM suppression feature (e.g., to clean up previous deployments, etc.), the agent must be set to look for the codestation.suppress.boms variable.

The Codestation BOM suppression feature can be configured either in the codestation.properties file, as an Ant task, or on the command-line tool:

  • codestation.properties file. Open the codestation.properties file (located in the user home directory) and configure property.

    Example properties file:

    codestation.server=https://anthillserver.company.com
    codestation.user=build
    codestation.password=buildpass
    codestation.noCheckCertificate=false
  • Ant task. Configure on Ant tasks with a boolean suppressBoms property. See Tools > Codestation Client.

  • Command-line tool. Configured on the command line tool with the suppressBoms option. See Tools > Codestation Client.

Set the agent to look for a boolean variable called codestation.suppress.boms. Once this has been set, the agent will ignore the codestation.properties file.

  1. Go to AnthillPro UI > Agents > Agent and select the appropriate agent from the list. You must have Administrative permissions to add an agent property. See Manage Security.

  2. Select the Agent Properties tab and create a new property.

  3. Give the property name, which is the same name as the property: codestation.suppress.boms.

Codestation Fallback to Offline

Use the Fallback-to-offline option to automatically switch Codestation offline if an error occurs while contacting the AnthillPro server. With this option, Codestation will only switch offline for the duration of a given Codestation command. Once the command completes, future commands will attempt to communicate with the server as normal.

The Fallback-to-offline option can be configured either in the codestation.properties file, as an Ant task, or on the command-line tool. Set the value for this option as "true" or "false".

  • codestation.properties file. Open the codestation.properties file (located in the user home directory). Configure with the property codestation.fallbackToOffline.

    Example properties file:

    codestation.server=https://anthillserver.company.com
    codestation.user=build
    codestation.password=buildpass
    codestation.noCheckCertificate=false
  • Ant task. Configure on Ant tasks with the fallbackToOffline attribute. See Tools > Codestation Client.

  • Command-line tool. Configure on the command line tool with the -fallbackToOffline option. See Tools > Codestation Client.

Codestation Secondary Cache

If remote teams have slow connection speeds, add the Codestation Secondary Cache on top of the currently supported local cache to improve performance. Once the secondary cache is set up on a network share (on the LAN), artifacts are pulled from AnthillPro once, and then shared among all the developers at the remote location. (Without the Secondary Cache, each developer must pull his/her own copy.)

For the codestation.properties file:

  1. Open the codestation.properties file (located in the user home directory).

  2. Configure with the property codestation.secondaryCache.dir.

    Example of properties file:

    codestation.server=https://anthillserver.company.com
    codestation.user=build
    codestation.password=buildpass
    codestation.noCheckCertificate=false

For the Agent (you must have administrative permissions to the agent):

  1. Go to AnthillPro UI > Agents > Agent and select the appropriate agent from the list.

  2. Select the Agent Properties tab and create a new property.

  3. Give the property name and value in the name=value format.

  4. Name. Same name as the property (codestation.secondaryCache.dir).

  5. Value. The path of the cache directory.

Codestation File-defined Dependency Configurations

You can use a Codestation method to set the dependencies of a Build Life from a file-defined resolve and then add it to the client and CLI. File-defined dependencies, using an XML file, is supported for both historical resolves and transitive dependencies. Once your file is configured, you can have Codestation pull down the dependencies.

For more, go to Tools > Developer Tools > Codestation Client.