Jenkins is a powerful application that allows continuous integration and continuous delivery of projects, regardless of the platform you are working on. It is a free source that can handle any kind of build or continuous integration. You can integrate Jenkins with a number of testing and deployment technologies.
For more details: https://jenkins.io/doc/tutorials/
Job Setup in Jenkins
When a Jenkins job executes, it sets some environment variables that you may use in your test script as environment variable, in shell script, batch command, Ant script or Maven POM. For our propose, we need following Jenkins environment variables:
|Environment Variable Name||Description|
|JOB_NAME||Name of the project of this build. This is the name you gave your job when you first set it up.|
|BUILD_NUMBER||The current build number, such as "153"|
Above environment variables can be used as command line parameters or can be accessed as environment variable with in script.
For more details: https://wiki.jenkins.io/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-JenkinsSetEnvironmentVariables
Apart from above two parameters, we might need third parameter "tags". We have to create custom parameters in Jenkins to pass tags.
Jenkins provides capability to define custom environment variables. These variables are available to scripts and command line tools as environment variable.
Create a parameterised build and define the following parameter:
You can pass one or more tags. You have to implement logic in your script to convert delimited string into array.
Note: You can create any variable, we have to use the same name in scripts. The variable names are case sensitive.
For more details: https://wiki.jenkins.io/display/JENKINS/Parameterized+Build
|Node.js||Nodejs and Reporting with Jenkins|