8.2.5. PTC Windchill RV&S / MKS Integrity

8.2.5.1. Background

You use PTC Windchill RV&S / PTC Integrity / MKS Integrity and want to set up a continuous integration and a dashboard server for Windows on the same machine.

For ease of reading, we will be calling the product just Integrity in the rest of this document, it however applies regardless of whether you are using MKS Integrity or PTC Windchill RV&S.

8.2.5.2. What can be configured?

You have to setup

  • continuous integration (e.g. via Jenkins CI)

  • dashboard as a Windows system service

8.2.5.3. What needs to be done?

The recommend approach to set up Integrity on a single build and dashboard machine:

  1. Setup two different technical users (e. g., jenkinsuser for build, dashboarduser for dashboard).

  2. As per user, create the following file %USERPROFILE%\IntegrityClient.rc with different port numbers (the port numbers must be unique on a single server).

    Restarting Integrity Client for dashboard
    IntegrityClient.port=31001
    
  3. The Integrity plugin for Jenkins does not work with sandboxes so the code analysis can not retrieve required information from the Integrity server. Instead, you have to use the si createsandbox commands subsequently.

  4. Use the following script to start Integrity client for each Jenkins job:

    Restarting Integrity Client for build
    taskkill /FI "USERNAME eq <DOMAIN>\jenkinsuser" /IM IntegrityClient.exe /F
    REM wait for some seconds to free the ports used
    timeout 5
    @echo si connect --batch --hostname=%MKSHOST% --user=jenkinsuser --password=***
    @si connect --batch --hostname=%MKSHOST% --user=jenkinsuser --password=%PASSWORD%
    @if ERRORLEVEL 1 echo Connection to MKS/PTC Integrity failed.
    exit /B 0
    
    Cleanup and checkout of sandboxes
    :: Drop Sandboxes for clean build
    si dropsandbox --delete=all -Y %WORKSPACE%/Sandbox/project.pj
    
    :: Recreate Sandboxes
    si createsandbox -Y --project="#/MyProject/is/here" %WORKSPACE%/Sandbox
    
    :: Run Analysis
    %WORKSPACE%\Axivion\start_analysis.bat
    

    If desired, you can replace the drop-create cycle above with

    Resync of sandboxes
    ::...
    si resync  --batch --recurse --includeDropped --overwriteChanged %WORKSPACE%/Sandbox
    @if ERRORLEVEL 1 (
       echo Cannot resync sandbox %WORKSPACE%/Sandbox.
       :: Create Sandboxes
       cd /D %WORKSPACE%/Sandbox
       si createsandbox -Y --project="%PROJECTROOT%" "%PROJECTPATH%"
       )
    ::...
    
  5. For the dashboard, setup the following script (e.g. restart_si.bat):

    Restarting Integrity Client for dashboard
    taskkill /FI "USERNAME eq <DOMAIN>\dashboarduser" /IM IntegrityClient.exe /F
    @echo si connect --batch --hostname=%MKSHOST% --user=dashboarduser --password=***
    @si connect --batch --hostname=%MKSHOST% --user=dashboarduser --password=%PASSWORD%
    @if ERRORLEVEL 1 echo Connection to MKS/PTC Integrity failed.
    exit /B 0
    
  6. Configure the prestart and poststop command entries in dashboard2.config to call restart_si.bat. Then, install the dashboard service.