Jenkins
Starting
Download jenkins.war
JENKINS_HOME stores the project instance
nohup is used to run the Jenkins in BG after the command exists
we used the 9090 port as an example, the user can set any available port.
On the success of the above command, you will see the Jenkins instance at
https://<host_name>:<port_number>
Assign the proper hostname and call jenkins using that hostname instead of IP.
Configuring
Nodes
Set up nodes for the available machines. You have to make them passwordless login. Set the number of executors for each node to more number.
You can assign "labels" to a group of nodes. Labels give flexibility to jobs for picking from a group of host machines.
You can have Linux and windows nodes co-exist in the same jenkins instance.
Global Settings
The allure tool has to be pointed in the Jenkins GLobal level setup
pipeline library should be added with a unique name, it will be referenced later using this name in scripts
Plugins
There are many valuable plugins from Jenkins.
Allure, Junit plugins
copyartifact : To store the artefacts generated in Jenkins Server
build-user-vars-plugin: to get the BUILD_USER and other info
build-name-setter: Set custom names to build instances
blueocean : Better Visualization of the pipeline jobs
build-timestamp: Adds Time stamp to Jenkins console log
ansicolor : Add colour prints to the Console
fstrigger : Trigger a jenkins job whenever the timestamp of the file gets changed.
Tips
The Jenkins server runs on a single core, its RAM consumption will be based on the number of jobs and their instances within it. Archiving Jobs and artefacts slow the Jenkins instance. It is advisable to reduce the number of jobs to keep it to a minimum ( 10 ).
Force quitting Jenkins is not recommended, it leaves many zombie processes. It is advisable to cancel once and wait for graceful termination.
Scripts
Declarative Pipeline
REST API
Notes:
For continuous Job submission with identical parameters, Jenkins will omit the queue and builds only one. We added a unique id for each job to overcome it, ensuring the queue jobs are run without lapsing.
Last updated