Devops Adv Qqaa
Devops Adv Qqaa
1. Go to Manage Jenkins
2. Click on Create User
3. Enter all the details
4. Select Create User
Jenkins, by default, runs on port number 8080. For changing the existing port
from 8080 to the desired port number, we can take the following steps:
Find –httpPort=8080 and replace the port 8080 with the new port number
Within the XML configuration, each Jenkins build is stored. When this folder is copied,
the configuration of all the build jobs that are managed by the Jenkins master is
backed up. If we can perform a Jenkins Git integration, then it is good. When we copy
the contents of the folder, we will see that the build jobs described in the folder will be
restored when the Jenkins server is started the next time.
Some of the important plugins that are used with Jenkins are:
Git repository
Amazon EC2
HTML Publisher
JDK Parameter Plugin
Configuration Slicing Plugin
Maven 2 project
Copy artifact
Join
Green Balls
Whenever one wants to integrate Jenkins with GitHub projects, the GitHub plugin can
be used. It is used to enable the scheduling of a build, pulling data and code files from
the GitHub repository to the Jenkins machine, and triggering every build automatically
on the Jenkins server after each commit on the Git repository. This saves time and
allows one to incorporate the specific project into the CI process.
Some of the important SCM tools that are supported by Jenkins include:
Git
Subversion
CVS
Mercurial
First, we need to ensure global security. Then, we have to make sure that Jenkins is
integrated with the user directory through an appropriate plugin. The project matrix is
enabled for fine tuning the access using the custom version-controlled script for
automating the process of rights and privileges in Jenkins. The access to Jenkins data
or folder is limited. We will run security audits on it.
If there is a broken build in your Jenkins project, then what will you
do?
First, we need to open the console output where the broken build is created and then see if
there are any file changes that were missed. If we do not find any issues in this manner, then
we can update our local workspace and replicate the problem and then try to solve it.
Mention what are the commands you can use to start Jenkins
manually?
How you can move or copy Jenkins from one server to another?
Stop Jenkins
Copy the custom HPI to $Jenkins_Home/plugins
Delete the previously expanded plugin directory
Make an empty file called <plugin>.hpi.pinned
Start Jenkins
Explain how can create a backup and copy files in Jenkins?
Jenkins saves all the setting, build artifacts and logs in its home directory, to
create a back-up of your Jenkins setup, just copy this directory. You can also
copy a job directory to clone or replicate a job or rename the directory.
To create a project that is handled via jobs in Jenkins. Select New item from
the menu, once this done enter a name for the job and select free-style job.
Then click OK to create new job in Jenkins. The next page enables you to
configure your job.
Jenkins can be manually started by opening the Console/Command line and using the
below commands:
Parameters are supported by the Agent section. They are used to support several use-
cases pipelines and are defined at the top-level of the pipeline or inside an individual
stage directive.
The agent directive specifies Jenkins how and where to execute the entire pipeline. The
directive is specified at the top-level inside the pipeline block and stage-level usage is
optional.
Flow control supports the pipeline structure (scripted pipeline) for executing the top to
bottom of the Jenkins file.
Command-line – For this, the client needs the executable agent.jar file. It helps to
launch the process on the client to communicate with the Jenkins master to run
build jobs.
Browser – This file launches a new process on the client machine to run jobs.
Jenkins Pipeline is a set of features of Jenkins, which are installed as plugins to enable
continuous delivery pipeline implementation. These are the automated processes to get
the software from source control through deployment to end-users.
JENKINS_HOME directory is used to store all the settings, configurations, and logs.
Groovy is a dynamic and agile language, offers seamless integration with all the existing Java libraries and
objects.
We can use scopes to define Collections or Arrays.
Allows you to add or remove collections
You have to enter the user name and email for your Jenkins system and turn it into your job directory and
execute the “git config” command for that.
Scripted pipelines are writing Jenkins pipelines as code in a traditional way. The scripted pipeline is defined
within a ‘node’.
The node is a part of the Jenkins architecture, where there are two types of a node, the agent or node will run
the part of the workload of the jobs, and the master node will handle the configuration of the job.
A declarative pipeline is a new feature in Jenkins that maintains the pipeline as a code and makes it easier to
write and read. It is defined within a block labeled pipeline.
Syntax:
any – It represents the whole pipeline will run on any available agent.
none – It indicates all the stages under the block will have to be declared with the agent separately.
Job DSL is one of the most important plugins for Jenkins that allows managing configuration as code. It is made
up of two parts. First, Domain Specific Language (DSL) that enables users to define jobs utilizing a Groovy-
based language, and second, a Jenkins plugin that manages the scripts and updates the created Jenkins jobs.
First, we need to copy our jobs directory from the old to the new server. There are
multiple ways to do it. We can either move the job from the installation by simply
copying the corresponding job directory or we can make a clone of the job directory
by making an existing job’s copy. For this, we need to have a different name, which
we can rename later.