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
-
Select
Discard old builds
and enter criteria. Note: The build artifacts will be deleted when old builds are discarded. -
Select
GitHub
Project and enter the URL for the GitHub hosted project (without the tree/master or tree/branch part). -
Select `This project is parameterized
- Add the following
String Parameter
MY_BUILD_NUMBER
- Add the following
String Parameter
sha1
- Add the following
-
Select
Restrict where this project can be run
- Set the Label Expression to
built-in
- Set the Label Expression to
Source Code Management
-
Select
Git
, enter the SSH clone URL for the repository, -
Enter the previous created SSH Key credentials (or click
Add
to create the credential) -
Click the
Advance
button.- Enter
epc
in theName
field - Enter the following for the Refspec field:
refs/heads/develop:refs/remotes/origin/develop
- Enter
-
Enter the following for the Branch Specifier field:
sha1
-
Click the
Add
button for Additional Behaviors and selectCustom user name/e-mail address
- Enter the GIT user name and email address that will be used when publishing to the GIT repo
Build Triggers
Uncheck all build triggers
Build Environment
-
Select
Add timestamps to the Console Output
-
Select
Terminate a build if it's stuck
and set the timeout to60
minutes
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.
-
Click the
Add build step
button and selectExecute Windows batch command
-
Enter the following command. Note: Pass the build number from the project's parameter list.
top\build_all_windows.bat %MY_BUILD_NUMBER% DEVELOP
-
Click the
Add build
button and selectExecute Windows batch command
-
Enter the following command. Note: Replace the
c:\bin
path with the location of where thecloc
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
Post Build Actions
Archive Artifacts
-
Click
Add post-build action
and select Archive the artifacts`. -
Enter the following for the _Files to archive' field:
_artifacts/*
E-mail Notification
-
Click
Add post-build action
and selectE-mail Notification
. -
Enter the email address of the technical lead and select
Send e-mail for every unstable build
andSend separate e-mails to individual who broke the build
options
Code Coverage Report
-
Click
Add post-build action
and selectPublish Cobertura Coverage Report
. -
Enter the following for the
Corbetura xml report pattern
**/tests/**/jenkins-gcovr.xml
-
Do not select
Enable New API
-
Accept the defaults for the
Advanced
options.
SLOCCount Report
-
Click
Add post-build action
and selectPublish SCLOCCount analysis results
. -
Enter
cloc.xml
in theSLOCCount reports
field.
Tag the build
-
Click
Add post-build action
and selectGit Publisher
. -
Select `Push Only If Build Succeeds
-
Click
Add Tag
- Enter
DEVELOP-${MY_BUILD_NUMBER} in the _Tag to push
field - Select
Create New Tag
- Enter
epc
in theTarget remote name
. Note: This is the Name of the repository configured in the Source Code Management step
- Enter