0% found this document useful (0 votes)
26 views8 pages

Devops Adv Qqaa

Uploaded by

Rohan Ashish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views8 pages

Devops Adv Qqaa

Uploaded by

Rohan Ashish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

How to add a user in Jenkins?

1. Go to Manage Jenkins
2. Click on Create User
3. Enter all the details
4. Select Create User

How to change port for Jenkins?

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:

1. Run Jenkins using the command line


2. Execute the command, java -jar -httpPort=desired_port jenkins.war

If Jenkins is installed using the Windows package, then:

1. Go to Program Files/Jenkins directory


2. Open Jenkins.xml in the editor

Find –httpPort=8080 and replace the port 8080 with the new port number

How to take a backup of your Jenkins build jobs?

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.

What are some of the useful plugins in Jenkins?

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

How to configure Docker in Jenkins?

To configure Docker in Jenkins, we have to follow the below steps:

1. First, we need to click on Manage Jenkins on the Jenkins dashboard.


2. We will then select Manage Plugins on the Configuration page.
3. Next, we need to click on Available once in the tabbed interface, and this will show
all the Jenkins plugins available for installation.
4. Then, we will search for a Docker plugin in the search box. There are multiple
Docker plugins to choose from.
5. Finally, we will select the Docker plugin.

When can you use the GitHub plugin in Jenkins?

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.

Name some of the SCM tools that are supported by Jenkins.

Some of the important SCM tools that are supported by Jenkins include:

 Git
 Subversion
 CVS
 Mercurial

Name two ways a Jenkins node agent can be configured to


communicate back with the Jenkins master.

These are the mechanisms for starting a Jenkins node agent:

 From the browser window, launch a Jenkins node agent


 From the command line, launch a Jenkins node agent
When we launch a Jenkins node agent, it will download a JNLP file. A new process is
launched on the client machine by JNLP when it runs.

What is the process for securing Jenkins?

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.

How to configure Jenkins with Maven?

To configure Jenkins with Maven:

1. On the Jenkins dashboard, go to Manage Jenkins, and select Configure System


2. Scroll down until the Maven section is seen, and then go to Add Maven
3. Uncheck the ‘Install automatically’ box
4. Add any name for the setting and the location of the MAVEN_HOME
5. After saving, one can create a job with the ‘Maven project’ option

How to create a slave node in Jenkins?

To create a slave node in Jenkins:

1. Go to Manage Jenkins, and scroll down to Manage Nodes


2. Click on New Node
3. Set the node name, choose the Dumb slave option, and then click on OK
4. Enter the node slave machine details, and click on Save

Mention what are the commands you can use to start Jenkins
manually?

To start Jenkins manually, you can use either of the following


 (Jenkins_url)/restart: Forces a restart without waiting for builds to
complete
 (Jenkin_url)/safeRestart: Allows all running builds to complete

How you can move or copy Jenkins from one server to another?

 Slide a job from one installation of Jenkins to another by copying the


related job directory
 Make a copy of an already existing job by making clone of a job directory
by a different name
 Renaming an existing job by renaming a directory.

Explain how you can deploy a custom build of a core plugin?

To deploy a custom field of a core plugin, you have to do following things

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

Explain how you can set up Jenkins job?

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.

Mention what are the two components Jenkins is mainly integrated


with?

Jenkin is mainly integrated with two components


 Version Control system like GIT, SVN
 And build tools like Apache Maven and or Management tool Ansible to
deploy …
How can you start Jenkins manually?

Jenkins can be manually started by opening the Console/Command line and using the
below commands:

 Start Jenkins: jenkins.exe start

 Stop Jenkins: jenkins.exe stop

 Restart Jenkins: jenkins.exe restart

What are the Parameters in Jenkins?

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.

What is the use of the Agent 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.

What is flow control in Jenkins?

Flow control supports the pipeline structure (scripted pipeline) for executing the top to
bottom of the Jenkins file.

What are the ways to configure Jenkins node agent to communicate


with Jenkins master?

Below mentioned ways help you to start the node agent –

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

What is a Jenkins Pipeline?

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.

What is the use of the JENKINS HOME directory?

JENKINS_HOME directory is used to store all the settings, configurations, and logs.

What is Groovy in Jenkins?


Apache Groovy is the default scripting language used for the JVM platform. It has some useful features like DSL
support, dynamic typing, and closures.

Some of the major features of using Groovy are:

 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

How do I clone a git repository using Jenkins?

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.

What are scripted pipelines?

Scripted pipelines are writing Jenkins pipelines as code in a traditional way. The scripted pipeline is defined
within a ‘node’.

Syntax of the Scripted Pipeline:

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.

What are declarative pipelines?

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:

The common syntax is:


1 pipeline {
2 /* Declarative Pipeline */
3 }

Structure of the declarative pipeline:

 any – It represents the whole pipeline will run on any available agent.

 docker – This is to run the pipeline in the Docker environment.

 none – It indicates all the stages under the block will have to be declared with the agent separately.

 label – This is just a label for the Jenkins environment

What is the difference between Agent, post-section, and Jenkinsfile?


 Agent: A directive that specifies Jenkins on how to execute the pipeline in a particular order or manner.
 Jenkinsfile: The text file which defines all the pipelines is called Jenkinsfile. It is being checked in the source
control repository.
 Post-section: It runs at the end of every pipeline’s execution.

What is DSL Jenkins?

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.

From one server to another, how do you copy or move


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

How to configure Jenkins with Maven?

To configure Jenkins with Maven:

1. On the Jenkins dashboard, go to Manage Jenkins, and select Configure System


2. Scroll down until the Maven section is seen, and then go to Add Maven
3. Uncheck the ‘Install automatically’ box
4. Add any name for the setting and the location of the MAVEN_HOME
5. After saving, one can create a job with the ‘Maven project’ option

How to create a slave node in Jenkins?

To create a slave node in Jenkins:


1. Go to Manage Jenkins, and scroll down to Manage Nodes
2. Click on New Node
3. Set the node name, choose the Dumb slave option, and then click on OK
4. Enter the node slave machine details, and click on Save

How to deploy from Jenkins?

1. On the Jenkins dashboard, go to Manage Jenkins and then to Manage Plugins. In


the Available section, tick off the ‘Deploy to Container Plugin’ box and install it.
Then, restart the Jenkins server
2. The next step is to go to the Build project and click on Configure. Choose the
‘Deploy war/ear to a container’ option
3. In the Deploy war/ear to a container section, enter the server details on which the
files need to be deployed, and press Save

You might also like