Jenkins Develop Stage1 Linux Build - johnttaylor/epc GitHub Wiki

Configure to build the develop branch for on a Linux host

Start by copying the CI-Stage1-linux. From the Dashboard->GM6000 page, select New Item from the left hand menu and enter the CI-Stage1-linux in the Copy from option, then click the OK button.

  • Do NOT use spaces in the project name.

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).

  3. Select Restrict where this project can bed run and enter the Linux Agent's name

    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 and enter the following for the Refspec field:

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

    • ${GITHUB_BRANCH_HEAD_SHA}
  5. Click the Add button to the Custom user name/e-mail address

    1. Enter a GitHub user and email address. This user/email address will be used by Jenkins when/if it pushes changes to GitHub

    image

Build Triggers

Note: The trigger uses a Cron job to pull for changes in the GitHub repository. This is required when the Jenkins server is behind a firewall and does not have a public IP address on the internet (i.e. can't be notified directly by GitHub when a change occurs).

  1. Select GitHub Branches

  2. Select Hooks plus Cron with Persisted Data

  3. Set the Crontab line to desired polled rate, e.g. once a minute: * * * * *

  4. Add the following _Trigger Events`

    • Branch Restrictions
      • Select Match branches against pattern criteria
      • Enter develop for the Branch Names or Patterns field
    • Hash Changed
  5. Accept the default Experimental options

    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 shell

  2. Enter the following command. Note: The Jenkins BUILD_NUMBER is passed to the script. The BUILD_NUMBER is the canonical build number for all software images in the project. For more details see Jenkins Build Number

    • top/build_linux.sh $BUILD_NUMBER

    image

Post Build Actions

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

Trigger parameterized build on other projects

  1. Click Add post-build action and select Trigger parameterized build on other projects.

  2. Enter the down stream project to build: Develop-Stage2-windows

  3. Add the following _Trigger Parameters`

    • Pass through Git Commit that was built
    • Predefined parameters and then enter the following lines:
      MY_BUILD_NUMBER=0
      sha1=${sha1}
      

    image

Set starting Build Number

  1. Set the starting build to 1000000 by clicking the -> Set Next Build Number from the left hand menu. Click here for more details about the build number