The CollabNet TeamForge Maven Deploy Plugin can be configured to post binary artifact deployment information to TeamForge via the Webhooks-based Event Broker for end-to-end traceability. Binary artifact deployment notifications are no longer sent to TeamForge EventQ for traceability.
Before You Begin
  • It is assumed that you have installed the TeamForge Webhooks-based Event Broker on the TeamForge Application Server. For more information, see Install the TeamForge Webhooks-based Event Broker.

  • Migrate the existing binary artifact data from EventQ’s MongoDB database to TeamForge database if you have been using EventQ to notify TeamForge with binary artifact data in TeamForge 19.1 or earlier. See Migrate Binary Artifact Data.

Configure the CollabNet TeamForge Maven Deploy Plugin

To configure the CollabNet TeamForge Maven Deploy Plugin:

  1. Replace the standard deploy plugin with CollabNet TeamForge Maven Deploy Plugin in your POM.xml.

    <pluginRepositories>
    <pluginRepository>
      <id>collabnet</id>
      <name>Collabnet Public Repo</name>
      <url>http://mvn.collab.net/nexus/content/groups/public/</url>
    </pluginRepository>
    </pluginRepositories>
    <plugins>
    ....
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <version>2.8.2</version>
        <configuration>
          <skip>true</skip>
        </configuration>
      </plugin>
      <plugin>
        <groupId>net.collab.maven.deploy</groupId>
        <artifactId>collabnet-deploy-maven-plugin</artifactId>
        <version>19.2</version>
        <extensions>true</extensions>
        <executions>
          <execution>
            <id>default-deploy</id>
            <phase>deploy</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <skipTeamForgeNotification>false</skipTeamForgeNotification>
          <ctfWebhookUrl>https://localhost:3000/inbox/BinaryCustomData/1001</ctfWehookUrl>
          <associatedBuildNumber>${env.BUILD_NUMBER}</associatedBuildNumber>
          <associatedJobName>${env.JOB_NAME}</associatedJobName>
          <skipLinkToBinaries>true</skipLinkToBinaries>         
        </configuration>
      </plugin>
    </plugins>
    

    The following table lists the available configuration items.

    Configuration Parameter Description Mandatory Default Value Example
    ctfWebhookUrl

    TeamForge Webhook URL.
    Note: You can obtain the TeamForge Webhook URL by running the create_webhook_event.py script.

    Yes None https://localhost:3000/inbox/BinaryCustomData/1001
    associatedBuildNumber Specify to the env variable depending on your build system process. Set to ${env.BUILD_NUMBER} for Jenkins. Yes None ${env.BUILD_NUMBER}
    associatedJobName Specify to the env variable depending on your build system process. Set ${env.JOB_NAME} for Jenkins. Yes None ${env.JOB_NAME}
    skipLinkToBinaries Set to true to download binary artifact from traceability view. If set to false, redirects to the download location of binary artifact. No true true
    skipTeamForgeNotification Set to true to disable notification. No false false
    component Used to identify a specific binary artifact as a component in a larger application. No None An ALM platform has several components such as an application server, an indexer, an SCM integration server and so on. These components have their own build process. This property is used to uniquely identify such components in TeamForge Webhooks-based Event Broker.
    componentOf Associated with the 'component' parameter to store the details of the component. No None SCM as a component of Teamforge.
  2. Set up the Nexus and TeamForge Webhooks-based Event Broker credentials in the settings.xml file.

    You may find this file in the Maven home directory. For example, in the following illustration, your distribution management section has a repository id as local-nexus and the webhook endpoint URL of the TeamForge Webhooks-based Event Broker as https://localhost:3000/inbox/BinaryCustomData/1001 (as configured earlier in the POM.xml file):

    <settings>
     <servers>
      <server>
       <id>local-nexus</id>
       <username>your_ctf_username</username>
       <password>xxxxxxxx</password>
      </server>
      <server>
       <id>https://localhost:3000/inbox/BinaryCustomData/1001</id>
       <username>webradmin</username>
       <password>webradminpassword</password>
      </server>
     </servers>
    </settings>
    

Migrate the Binary Artifact Data from EventQ to TeamForge

After configuring the CollabNet Maven Deploy Plugin, you must migrate the binary artifact data from EventQ’s MongoDB database to TeamForge database post upgrade to TeamForge 19.2.

Before migrating the binary artifact data from EventQ to TeamForge, create the config.properties file with the following tokens in the /tmp directory and keep it handy.

#Default Mongo DB host is "localhost"
MONGO_DB_HOST=localhost

#Default Mongo DB port is "27017"
MONGO_DB_PORT=27017

MONGO_DB_NAME=eventq
MONGO_DB_USERNAME=eventq

#Enter (y)es or (n)o for CTF_USES_ORACLE_DB
CTF_USES_ORACLE_DB=n

#If CTF_USES_ORACLE=(y)es, enter ORACLE_SID
ORACLE_SID=

CTF_HOST_NAME=<TeamForge host name or domain name>
CTF_PORT=5432

#If CTF_USES_ORACLE=(n)o, enter CTF_DB_NAME
CTF_DB_NAME=teamforge
CTF_DB_USERNAME=teamforge

To migrate the existing binary artifact data:

  1. Extract the existing binary artifact data from EventQ’s MongoDB database and generate an SQL file based on the TeamForge database you have (Postgres/Oracle).
  2. Execute the generated SQL file on the TeamForge database (Postgres/Oracle).

Extract Binary Artifact Data from EventQ MongoDB

  1. Download the CollabNet Maven deploy plugin collabnet-deploy-maven-plugin-1.0.jar.

  2. Run this command to execute the migration script.

     java -jar collabnet-deploy-maven-plugin-1.0.jar -m -f /tmp/config.properties
    
  3. Enter the MongoDB password and TeamForge database password, when prompted.

    The migration script is executed and generates the collabnet_deploy_maven_plugin_data_migration.sql file.

Execute the SQL File on the PostgreSQL/Oracle Database

  • To execute the SQL file on PostgreSQL Database:

    1. Log on to TeamForge Server.

    2. Run this command to import the migrated data.

      sudo /opt/collabnet/teamforge/runtime/scripts/psql-wrapper <filepath of `collabnet_deploy_maven_plugin_data_migration.sql`> 
      

      OR

      cat <filepath of `collabnet_deploy_maven_plugin_data_migration.sql`> | sudo /opt/collabnet/teamforge/runtime/scripts/psql-wrapper 
      
  • To execute the SQL file on Oracle Database:

    1. Log on to your Oracle database.

    2. Run this command to import the migrated data.

      @<filepath of `collabnet_deploy_maven_plugin_data_migration.sql`>
      
Tags for this page: ctf_19.2 source_code