Jenkins Develop Stage2 Windows Build - johnttaylor/epc GitHub Wiki

Configure to build Pull Requests for a Windows host

Note: Only the minimal configuration is show, i.e. additional configuration as needed can be added.

General

  1. Select Discard old builds and enter criteria. Note: The build artifacts will be deleted when old builds are discarded.

  2. Select GitHub Project and enter the URL for the GitHub hosted project (without the tree/master or tree/branch part).

    image

  3. Select `This project is parameterized

    1. Add the following String Parameter
      • MY_BUILD_NUMBER
    2. Add the following String Parameter
      • sha1
  4. Select Restrict where this project can be run

    • Set the Label Expression to built-in

    image

Source Code Management

  1. Select Git, enter the SSH clone URL for the repository,

  2. Enter the previous created SSH Key credentials (or click Add to create the credential)

  3. Click the Advance button.

    • Enter epc in the Name field
    • Enter the following for the Refspec field:
      • refs/heads/develop:refs/remotes/origin/develop
  4. Enter the following for the Branch Specifier field:

    • sha1
  5. Click the Add button for Additional Behaviors and select Custom user name/e-mail address

    • Enter the GIT user name and email address that will be used when publishing to the GIT repo

    image

Build Triggers

Uncheck all build triggers

image

Build Environment

  1. Select Add timestamps to the Console Output

  2. Select Terminate a build if it's stuck and set the timeout to 60 minutes

    image

Build Steps

Note: There is single batch/script file in the repository that is responsible for building and executing all unit tests. In addition, the script builds the release and debug version of the target and simulator executables.

  1. Click the Add build step button and select Execute Windows batch command

  2. Enter the following command. Note: Pass the build number from the project's parameter list.

    • top\build_all_windows.bat %MY_BUILD_NUMBER% DEVELOP
  3. Click the Add build button and select Execute Windows batch command

  4. Enter the following command. Note: Replace the c:\bin path with the location of where the cloc executable was downloaded/stored.

    • c:\bin\cloc-1.96.exe --exclude-lang=xml,md,py,txt --exclude-dir=_0test,Catch,Bsp --exclude-list-file=top\cloc-exclude-list.txt --by-file --xml --out=cloc.xml src

    image

Post Build Actions

Archive Artifacts

  1. Click Add post-build action and select Archive the artifacts`.

  2. Enter the following for the _Files to archive' field:

    • _artifacts/*

    image

E-mail Notification

  1. Click Add post-build action and select E-mail Notification.

  2. Enter the email address of the technical lead and select Send e-mail for every unstable build and Send separate e-mails to individual who broke the build options

    image

Code Coverage Report

  1. Click Add post-build action and select Publish Cobertura Coverage Report.

  2. Enter the following for the Corbetura xml report pattern

    • **/tests/**/jenkins-gcovr.xml
  3. Do not select Enable New API

  4. Accept the defaults for the Advanced options.

    image

SLOCCount Report

  1. Click Add post-build action and select Publish SCLOCCount analysis results.

  2. Enter cloc.xml in the SLOCCount reports field.

    image

Tag the build

  1. Click Add post-build action and select Git Publisher.

  2. Select `Push Only If Build Succeeds

  3. Click Add Tag

    • Enter DEVELOP-${MY_BUILD_NUMBER} in the _Tag to push field
    • Select Create New Tag
    • Enter epc in the Target remote name. Note: This is the Name of the repository configured in the Source Code Management step

    image