0% found this document useful (0 votes)
25 views18 pages

Jenkins Int

Uploaded by

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

Jenkins Int

Uploaded by

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

JENKINS

Interview Questions
1. What is Jenkins?

Answer: Jenkins is an open-source automation server used for continuous integration and continuous
delivery (CI/CD). It automates the building, testing, and deployment of software, allowing for rapid
development and release cycles.

2. What are the main features of Jenkins?

Answer: Key features of Jenkins include:

Extensible through plugins

Easy installation and setup

Support for various SCM tools like Git, SVN, and Mercurial

Integration with multiple build tools like Maven, Gradle, and Ant

Built-in support for continuous integration and continuous delivery

3. How does Jenkins work?

Answer: Jenkins works by automating the process of building, testing, and deploying applications. It
uses a pipeline concept where a series of steps are defined in Jenkinsfile to automate the CI/CD
process. Jenkins polls the source code repository for changes and triggers jobs based on predefined
criteria.

4. What is a Jenkins job?

Answer: A Jenkins job is a task or set of tasks that Jenkins executes. It can be configured to build, test,
or deploy software, and can be triggered manually or automatically based on various conditions.

5. What is a Jenkins pipeline?

Answer: A Jenkins pipeline is a suite of plugins that support implementing and integrating continuous
delivery pipelines into Jenkins. It defines the steps for building, testing, and deploying code. Pipelines
can be defined using a Jenkinsfile, which can be stored in the source code repository.

6. What is a Jenkinsfile?
Answer: A Jenkinsfile is a text file that contains the definition of a Jenkins pipeline. It is written in
Groovy or Declarative syntax and defines the stages and steps of the CI/CD pipeline.

7. What is the difference between declarative and scripted pipelines in Jenkins?

Answer: Declarative pipelines are a more recent, simpler way to define Jenkins pipelines using a
structured and predefined syntax. Scripted pipelines offer more flexibility and control but are written
in Groovy and can be more complex.

8. How do you create a new Jenkins job?


Answer: To create a new Jenkins job, navigate to the Jenkins dashboard, click on "New Item," enter a
name for the job, select the type of job (e.g., Freestyle project, Pipeline), and click "OK." Then configure
the job by defining its build steps, triggers, and other settings.

9. What is Jenkins Blue Ocean?

Answer: Jenkins Blue Ocean is a modern user interface for Jenkins that provides a simplified and
streamlined experience for designing, managing, and visualizing Jenkins pipelines. It offers better
visualization and user experience for pipeline creation and management.

10. How can you configure Jenkins to send notifications?

Answer: Jenkins can be configured to send notifications through various plugins like Email Extension
Plugin, Slack Notification Plugin, and others. Notifications can be set up to inform users of build
statuses, test results, and other events.

11. What is the purpose of Jenkins plugins?

Answer: Jenkins plugins extend the functionality of Jenkins by adding new features or integrating with
other tools and services. Plugins can be used to support different SCM tools, build tools, notification
systems, and more.

12. How do you install Jenkins plugins?

Answer: Install Jenkins plugins by navigating to "Manage Jenkins" > "Manage Plugins," selecting the
"Available" tab, searching for the desired plugin, and clicking "Install without restart." Plugins can also
be installed from the "Advanced" tab by uploading a .hpi or .jpi file.

13. What is the Jenkins master-slave architecture?


Answer: The Jenkins master-slave architecture involves a central Jenkins master that manages jobs and
coordinates builds, while one or more Jenkins slaves (or agents) execute the builds. This setup allows
for distributed builds and scaling of build capacity.

14. How do you configure a Jenkins slave?

Answer: Configure a Jenkins slave by navigating to "Manage Jenkins" > "Manage Nodes and Clouds" >
"New Node," entering the node name, selecting "Permanent Agent," and configuring the node details
such as remote root directory, usage, and launch method (e.g., via SSH or JNLP).

15. What is the difference between a Jenkins job and a Jenkins build?

Answer: A Jenkins job is a configuration for a task or set of tasks, while a Jenkins build is an instance of
that job being executed. A job can have multiple builds over time, each representing a specific
execution of the job.

16. What are Jenkins build triggers?

Answer: Jenkins build triggers are conditions or events that automatically start a build. Examples
include source code changes (SCM polling), scheduled times (cron), and manual triggers (user input).

17. How do you manage Jenkins credentials?

Answer: Manage Jenkins credentials by navigating to "Manage Jenkins" > "Manage Credentials,"
where you can add, update, or remove credentials. Credentials can be used to authenticate with
external systems and services securely.

18. What is a Jenkins artifact?

Answer: A Jenkins artifact is a file or set of files produced as a result of a build. Artifacts can be used
for further deployment, testing, or archiving. Examples include compiled binaries, logs, and
documentation.

19. What is the purpose of Jenkins SCM integration?

Answer: Jenkins SCM (Source Code Management) integration allows Jenkins to interact with version
control systems (e.g., Git, SVN) to fetch source code, trigger builds based on changes, and manage
build versions.

20. How do you configure a Jenkins pipeline for continuous deployment?


Answer: Configure a Jenkins pipeline for continuous deployment by defining stages in the Jenkinsfile
for building, testing, and deploying the application. Use plugins and scripts to automate deployment
to various environments.

21. What are Jenkins environment variables?

Answer: Jenkins environment variables are variables that can be used within Jenkins jobs and pipelines
to store configuration values, such as build numbers, workspace paths, and credentials.

22. How do you handle Jenkins build failures?

Answer:

Handle Jenkins build failures by configuring post-build actions to notify relevant stakeholders, analyze
build logs to identify issues, and implement error handling and retry mechanisms in the pipeline.

23. What is a Jenkins build pipeline?

Answer: A Jenkins build pipeline is a sequence of stages and steps defined in a Jenkinsfile that
represents the CI/CD process. It includes steps for building, testing, and deploying code and allows
visualization of the pipeline flow.

24. How do you use Jenkins with Docker?

Answer: Use Jenkins with Docker by configuring Jenkins to build Docker images, run containers as part
of the build process, and manage Docker environments. The Docker plugin for Jenkins facilitates
integration with Docker.

25. What is the Jenkins pipeline DSL?

Answer: The Jenkins pipeline DSL (Domain-Specific Language) is a Groovy-based language used to
define Jenkins pipelines. It provides a structured way to define stages, steps, and other pipeline
components.

26. How do you handle parallel execution in Jenkins pipelines?

Answer: Handle parallel execution in Jenkins pipelines by using the parallel directive in the pipeline
script. It allows for running multiple stages or steps concurrently to speed up the CI/CD process.

27. What is Jenkins Declarative Pipeline?

Answer: Jenkins Declarative Pipeline is a simplified and structured syntax for defining Jenkins pipelines.
It uses a predefined set of directives to define stages, steps, and other pipeline elements in a more
readable format.
28. How do you set up Jenkins to work with a specific Git repository?

Answer: Set up Jenkins to work with a specific Git repository by configuring the repository URL,
credentials, and branch information in the Jenkins job or pipeline configuration. Use the Git plugin to
integrate Jenkins with Git repositories.

29. What is the purpose of Jenkins post section in a pipeline?

Answer: The post section in a Jenkins pipeline is used to define actions that should be executed after
the main pipeline stages, regardless of the build outcome. It can include steps for cleanup,
notifications, and archiving.

30. How do you secure Jenkins?

Answer: Secure Jenkins by configuring proper authentication and authorization, using SSL/TLS for
secure communication, regularly updating Jenkins and plugins, and implementing security best
practices such as role-based access control.

31. What is Jenkins Workspace?

Answer: Jenkins Workspace is a directory on the Jenkins agent where build files and artifacts are
stored. Each Jenkins job has its own workspace, which is used to check out source code and perform
build operations.

32. How do you manage Jenkins backups?

Answer: Manage Jenkins backups by regularly backing up the Jenkins home directory, which contains
configuration files, job data, and plugins. Use plugins or external tools to automate and manage the
backup process.

33. What is the Jenkinsfile when directive used for?

Answer: The when directive in a Jenkinsfile is used to conditionally execute stages or steps based on
certain criteria. It allows for dynamic execution of parts of the pipeline based on conditions such as
branch names or environment variables.

34. How do you use Jenkins with Kubernetes?

Answer: Use Jenkins with Kubernetes by configuring Jenkins to run on a Kubernetes cluster, where
Jenkins agents (or pods) can be dynamically provisioned. The Kubernetes plugin for Jenkins helps
integrate Jenkins with Kubernetes, enabling you to run CI/CD jobs in isolated environments on
demand, improving scalability and resource management.
35. What is Jenkins poll SCM?

Answer: Poll SCM is a build trigger in Jenkins that periodically checks the source code repository for
changes. If changes are detected, Jenkins automatically triggers a build. The polling interval is
configured using a cron expression, allowing Jenkins to check for updates at specified intervals.

36. How do you configure Jenkins for continuous integration?

Answer: Configure Jenkins for continuous integration by setting up jobs or pipelines that automatically
build and test the code whenever changes are pushed to the repository. You can use SCM polling,
webhooks, or other triggers to start builds, ensuring that code is consistently tested and integrated.

37. How do you handle Jenkins job dependencies?

Answer: Handle Jenkins job dependencies by configuring upstream and downstream jobs. An
upstream job triggers one or more downstream jobs upon completion. You can also use the build step
in pipelines to explicitly trigger jobs that have dependencies, ensuring that jobs are executed in the
correct sequence.

38. What are Jenkins stages and steps?

Answer: In Jenkins pipelines, stages represent distinct phases of the CI/CD process, such as "Build,"
"Test," and "Deploy." Each stage can contain multiple steps, which are the specific tasks performed
within that stage, like running shell commands, building code, or deploying artifacts.

39. How do you use Jenkins to deploy applications?

Answer: Use Jenkins to deploy applications by defining deployment steps in a Jenkins pipeline. This
may involve copying artifacts to servers, running deployment scripts, or interacting with deployment
tools like Ansible, Docker, or Kubernetes. Jenkins can automate the entire deployment process,
ensuring consistency and reliability.

40. What is Jenkins Groovy script?

Answer: A Groovy script in Jenkins is used to define scripted pipelines or to automate various Jenkins
tasks. Groovy is the scripting language behind Jenkins pipelines, allowing for more flexible and
powerful configurations. It enables custom scripting for complex CI/CD workflows.

41. How do you use Jenkins with Maven?

Answer: Jenkins integrates with Maven using the Maven plugin. To use Jenkins with Maven, create a
Maven job in Jenkins, specify the POM file, and configure the Maven goals (e.g., clean, install). Jenkins
will run the Maven build process, compile the code, and handle dependencies, tests, and packaging.
42. What is Jenkins archiveArtifacts step?

Answer:The archiveArtifacts step in Jenkins is used to archive build artifacts (e.g., compiled binaries,
reports) for future reference. This step specifies which files or directories to archive, allowing you to
keep a record of the outputs from each build, which can be accessed later for debugging or
deployment.

43. How do you use Jenkins with GitHub?

Answer: Integrate Jenkins with GitHub by configuring Jenkins to pull code from a GitHub repository.
This involves installing the Git plugin, setting up credentials, and configuring a job or pipeline with the
repository URL. You can also use webhooks to trigger Jenkins builds automatically when changes are
pushed to GitHub.

44. What is Jenkins input step?

Answer: The input step in Jenkins is used to pause the pipeline and wait for human input before
proceeding. This is often used in scenarios where manual approval is needed, such as deploying to
production. The pipeline continues only after the input is provided or approved by a user.

45. How do you use Jenkins with SVN?

Answer: Jenkins can be integrated with SVN (Subversion) by using the SVN plugin. Configure Jenkins
to check out code from an SVN repository by specifying the repository URL and credentials in the job
or pipeline. Jenkins will fetch the code from SVN and execute the build or deployment process.

46. What is Jenkins checkout step?

Answer: The checkout step in Jenkins is used to check out code from a version control system (like Git
or SVN) into the workspace. This step is often the first in a pipeline, ensuring that the latest code is
available for building, testing, and deploying.

47. How do you use Jenkins for continuous delivery?

Answer: Jenkins supports continuous delivery by automating the entire process from code commit to
deployment. A Jenkins pipeline can be set up with stages for building, testing, and deploying code to
various environments. By integrating with deployment tools and using proper triggers, Jenkins ensures
code is continuously delivered to production.

48. How do you secure Jenkins credentials?

Answer: Jenkins credentials can be secured by storing them in the Jenkins Credential Store. Credentials
are encrypted and can be managed through the Jenkins UI under "Manage Jenkins" > "Manage
Credentials." Access to credentials can be restricted using role-based access control, ensuring only
authorized users and jobs can use them.

49. How do you handle secrets in Jenkins pipelines?

Answer: Handle secrets in Jenkins pipelines by using the credentials step or by integrating with secret
management tools like HashiCorp Vault or AWS Secrets Manager. This ensures sensitive information,
like passwords and API keys, is securely injected into the pipeline without being exposed in the code.

50. What is Jenkins pipeline-as-code?


Answer: Pipeline-as-code refers to defining Jenkins pipelines using code, typically in a Jenkinsfile that
is stored in the source code repository. This approach allows the pipeline configuration to be versioned
and managed alongside the application code, improving maintainability and collaboration.

51. How do you use Jenkins with AWS?

Answer: Jenkins can be integrated with AWS using various plugins, such as the AWS CodeDeploy plugin
or the Amazon EC2 plugin. Jenkins can deploy applications to AWS services, provision EC2 instances
for builds, or interact with other AWS services as part of the CI/CD pipeline.

52. What is Jenkins post condition?

Answer: The post condition in a Jenkins pipeline is used to define actions that should occur after the
pipeline's main stages have completed, regardless of the outcome. This can include steps for cleanup,
notifications, or archiving artifacts, ensuring necessary tasks are always executed.

53. How do you manage Jenkins jobs using the Jenkins REST API?

Answer: Jenkins provides a REST API that allows you to manage jobs, trigger builds, and retrieve build
information programmatically. You can use HTTP requests to interact with the API, automating tasks
like job creation, job execution, and fetching build statuses.

54. What is Jenkins Multibranch Pipeline?

Answer: A Multibranch Pipeline in Jenkins automatically creates and manages pipelines for multiple
branches of a repository. It allows Jenkins to detect branches in the repository and run the appropriate
pipeline for each branch, making it easier to handle CI/CD for projects with multiple active branches.

55. How do you integrate Jenkins with JIRA?


Answer: Integrate Jenkins with JIRA using the JIRA plugin. This integration allows Jenkins to update
JIRA tickets with build results, create JIRA issues from Jenkins, and link Jenkins jobs to JIRA issues. It
helps in tracking the progress of issues and linking CI/CD activities with project management.

56. What is Jenkins Declarative Agent?

Answer: The agent directive in a Declarative Jenkins pipeline defines where the pipeline or a specific
stage runs. It can specify a Jenkins agent or node label, allowing you to control the environment in
which the pipeline executes.

57. How do you use Jenkins with Docker Compose?

Answer: Use Jenkins with Docker Compose by writing a pipeline that includes steps to build and start
services using docker-compose. Jenkins can run Docker Compose commands to bring up multi-
container applications, execute tests, and tear down the environment as part of the CI/CD process.

58. What is Jenkins Build Pipeline plugin?

Answer: The Jenkins Build Pipeline plugin provides visualization of the upstream and downstream
dependencies of Jenkins jobs. It allows you to visualize complex build pipelines, showing how jobs
trigger other jobs and the overall flow of the build process.

59. How do you handle long-running builds in Jenkins?

Answer: Handle long-running builds in Jenkins by using build timeouts, splitting the build into smaller
stages or jobs, or running builds on more powerful agents. You can also configure Jenkins to send
notifications or alerts if a build exceeds a certain time threshold.

60. What is Jenkins stage view?

Answer: The stage view in Jenkins provides a graphical representation of the different stages in a
pipeline. It shows the progress and results of each stage, allowing users to quickly understand where
the pipeline is and identify any issues in the workflow.

61. How do you manage Jenkins configurations?

Answer: Manage Jenkins configurations by exporting the configuration files, using configuration
management tools like Ansible or Chef, and version-controlling Jenkinsfiles. Additionally, plugins like
Job DSL or Configuration as Code (JCasC) can automate the setup and management of Jenkins
configurations.

62. What is Jenkins trigger another project?


Answer: The Trigger another project option in Jenkins allows one job to start another job after it
completes. This is used to create job dependencies, where the completion of one job automatically
triggers the execution of another, enabling chained workflows.

63. How do you back up Jenkins?

Answer: Back up Jenkins by copying the Jenkins home directory, which contains job configurations,
plugins, and build history. You can also use backup plugins to automate the process. Regular backups
ensure that Jenkins can be restored in case of failure or data loss.

64. What is Jenkins build periodically?

Answer: Build periodically is a build trigger in Jenkins that schedules builds at specific intervals,
regardless of whether there are changes in the source code. This is configured using a cron expression
and is useful for jobs that need to run regularly, such as nightly builds.

65. How do you use Jenkins for automated testing?

Answer: Use Jenkins for automated testing by integrating it with testing frameworks and tools.
Configure Jenkins to run tests as part of the build process, collect test results, and publish reports. This
ensures that code changes are automatically validated through testing.

66. What is Jenkins JUnit plugin?

Answer: The Jenkins JUnit plugin allows Jenkins to process and visualize test results in the JUnit format.
After running tests, Jenkins can parse the test reports, display the results in the build summary, and
track test trends over time.

67. How do you manage multiple Jenkins nodes?

Answer: Manage multiple Jenkins nodes by configuring them in the Jenkins UI under "Manage Jenkins"
> "Manage Nodes." You can add, remove, and monitor nodes, as well as assign labels to control where
specific jobs run. Nodes help distribute the load across multiple machines.

68. What is Jenkins Scripted Pipeline?

Answer: A Scripted Pipeline in Jenkins is a pipeline defined using Groovy scripting syntax. It offers more
flexibility and control compared to Declarative Pipelines but requires more manual coding. Scripted
Pipelines allow complex logic and custom scripting within the pipeline.

69. How do you use Jenkins with Terraform?


Answer: Use Jenkins with Terraform by creating a pipeline that runs Terraform commands to provision
and manage infrastructure. Jenkins can automate the execution of Terraform plans and applies,
integrate with version control for IaC (Infrastructure as Code), and manage Terraform states.

70. What is Jenkins DSL?

Answer: Jenkins DSL (Domain Specific Language) is used to define Jenkins jobs programmatically. The
Job DSL plugin allows you to create and configure Jenkins jobs using Groovy scripts, enabling version
control of job configurations and easier management of complex job setups.

71. What is Jenkins quiet period?

Answer: The quiet period in Jenkins is a delay applied before starting a build after a job is triggered. It
ensures that any additional commits or changes made shortly after the initial trigger are included in
the build. The default quiet period is 5 seconds, but it can be configured per job.

72. How do you set up a Jenkins job to run only on specific nodes?

Answer: To set up a Jenkins job to run only on specific nodes, you can assign a label to the desired
nodes and then configure the job to run on those labeled nodes by specifying the label in the job's
configuration under "Restrict where this project can be run."

73. What is Jenkins workspace?

Answer: A Jenkins workspace is a directory on a Jenkins agent where the files required for the build
process are checked out and where the build is executed. Each job has its own workspace, ensuring
isolation between builds and preventing interference between different jobs.

74. How do you configure Jenkins to send notifications?

Answer: Jenkins can be configured to send notifications via email, Slack, or other communication
channels. This is typically done using plugins like the Email Extension Plugin or Slack Notification Plugin.
Notifications can be triggered based on build results, such as success, failure, or unstable builds.

75. What is Jenkins Declarative Pipeline?

Answer: A Declarative Pipeline in Jenkins is a pipeline defined using a more structured and user-
friendly syntax compared to Scripted Pipelines. It uses a predefined format to simplify pipeline
creation, making it easier to read, write, and maintain CI/CD pipelines.

76. How do you use Jenkins with Ansible?


Answer: Use Jenkins with Ansible by creating a Jenkins job or pipeline that executes Ansible playbooks.
This can be done using the Ansible plugin or by running Ansible commands within a pipeline script.
Jenkins can automate the execution of Ansible tasks, such as configuration management and
deployment.

77. What is Jenkins Blue Ocean?

Answer: Jenkins Blue Ocean is a modern user interface for Jenkins that provides a more intuitive and
visual way to create, view, and manage pipelines. It offers a streamlined experience with features like
pipeline visualization, easier pipeline editing, and better integration with version control systems.

78. How do you handle environment variables in Jenkins?

Answer: Environment variables in Jenkins can be managed by setting them in the job or pipeline
configuration, using the environment directive in Declarative Pipelines, or by injecting them from
external sources like the Jenkins environment injector plugin. They can be used to customize build and
deployment processes.

79. What is Jenkins build with parameters?


Answer: Build with parameters in Jenkins allows users to trigger a job with specific inputs or
parameters. This is useful for running jobs with different configurations or inputs, such as selecting a
branch to build or specifying environment variables for the build.

80. How do you secure Jenkins?


Answer: Secure Jenkins by enabling authentication and authorization, restricting access to the Jenkins
UI, using HTTPS for secure communication, regularly updating Jenkins and plugins, and limiting access
to sensitive data and credentials. Role-based access control (RBAC) and auditing are also key security
measures.

81. What is Jenkins artifact?

Answer: An artifact in Jenkins refers to files generated as part of a build process, such as compiled
binaries, JAR files, or reports. These artifacts can be archived by Jenkins for future reference,
deployment, or distribution, ensuring that important outputs of the build are preserved.

82. How do you use Jenkins with Bitbucket?


Answer: Use Jenkins with Bitbucket by configuring a Jenkins job or pipeline to pull code from a
Bitbucket repository. This can be done using the Git plugin and setting up webhooks in Bitbucket to
trigger Jenkins builds automatically when changes are pushed to the repository.
83. What is Jenkins node in a pipeline?

Answer: In a Jenkins pipeline, a node block allocates an agent (or node) where the pipeline or a specific
part of it will run. It ensures that the workspace and resources are available for the pipeline to execute,
and different stages can run on different nodes if needed.

84. How do you use Jenkins for code quality analysis?

Answer: Jenkins can be used for code quality analysis by integrating with tools like SonarQube,
Checkstyle, PMD, and FindBugs. Jenkins jobs or pipelines can be configured to run these tools as part
of the build process, generating reports and enforcing quality gates based on the analysis results.

85. What is Jenkins parallel step?

Answer: The parallel step in Jenkins allows you to execute multiple stages or steps concurrently within
a pipeline. This can significantly reduce the overall build time by running independent tasks
simultaneously, such as running tests on different environments in parallel.

86. How do you monitor Jenkins performance?

Answer: Monitor Jenkins performance using tools like the Jenkins Monitoring Plugin, which provides
metrics on CPU, memory usage, and job execution times. You can also analyze system logs, set up
alerts for resource thresholds, and use external monitoring tools like Nagios or Prometheus for
comprehensive monitoring.

87. What is Jenkins Jenkinsfile?

Answer: A Jenkinsfile is a text file that contains the definition of a Jenkins pipeline. It is typically stored
in the source code repository and allows the pipeline configuration to be versioned alongside the code.
Jenkinsfile can be written using either Declarative or Scripted Pipeline syntax.

88. How do you handle failed builds in Jenkins?

Answer: Handle failed builds in Jenkins by setting up post-build actions such as notifications, retries,
or rolling back changes. You can also analyze the build logs to diagnose the issue, use post conditions
to perform cleanup, and trigger corrective actions like re-running tests or deploying a previous stable
version.

89. What is Jenkins build history?

Answer: The build history in Jenkins is a record of all past builds for a job. It includes information such
as build status, duration, triggered cause, and any associated artifacts or logs. The build history helps
in tracking the progress and stability of a job over time.
90. How do you use Jenkins with Nagios?

Answer: Integrate Jenkins with Nagios by configuring Nagios to monitor Jenkins services and trigger
alerts based on the health and performance of Jenkins jobs. You can also use the Nagios plugin for
Jenkins to send notifications from Jenkins to Nagios, allowing Nagios to act on Jenkins build statuses.

91. What is Jenkins build pipeline view?

Answer: The build pipeline view in Jenkins provides a graphical representation of the sequence of jobs
in a pipeline. It shows the flow of the pipeline, including the upstream and downstream jobs, making
it easier to understand the build process and monitor its progress.

92. How do you create a Jenkins plugin?

Answer: Create a Jenkins plugin by setting up a development environment using the Jenkins Plugin
Development Kit (PDK) or Maven, writing the plugin code in Java, and defining the plugin's
functionality. Once developed, the plugin can be packaged, tested, and deployed to a Jenkins instance.

93. What is Jenkins input step with approval?

Answer: The input step with approval in Jenkins is used to pause a pipeline and wait for manual
approval before continuing. This step is often used in deployment stages where human intervention is
required to approve the deployment to production or other critical environments.

94. How do you integrate Jenkins with GitLab?

Answer: Integrate Jenkins with GitLab by configuring GitLab to send webhooks to Jenkins when code
is pushed or merged. The GitLab plugin for Jenkins can also be used to fetch code from GitLab, trigger
builds based on GitLab events, and report build statuses back to GitLab.

95. What is Jenkins post-build action?

Answer: A post-build action in Jenkins is a task that is executed after the build process is completed.
Common post-build actions include sending notifications, archiving artifacts, publishing reports, and
triggering other jobs. These actions help in managing the outcomes of the build.

96. How do you use Jenkins for infrastructure as code (IaC)?

Answer: Use Jenkins for infrastructure as code (IaC) by integrating it with tools like Terraform, Ansible,
or CloudFormation. Jenkins can automate the provisioning and management of infrastructure by
running IaC scripts as part of a pipeline, ensuring consistent and repeatable infrastructure setups.
97. What is Jenkins extended choice parameter?

Answer: The extended choice parameter in Jenkins is an advanced parameter type that allows more
complex user inputs in a job, such as selecting multiple values from a list or dynamically generating
options based on external sources. It is useful for jobs that require customizable inputs.

98. How do you use Jenkins with Azure DevOps?

Answer: Integrate Jenkins with Azure DevOps by configuring Jenkins to fetch code from Azure Repos,
trigger builds based on Azure Pipelines, or deploy artifacts to Azure resources. The Azure DevOps
plugin for Jenkins can facilitate this integration, allowing seamless CI/CD across both platforms.

99. What is Jenkins quiet down mode?

Answer: Jenkins quiet down mode is a state where Jenkins stops scheduling new builds but continues
processing ongoing builds. This mode is useful for maintenance tasks or when preparing to shut down
Jenkins without disrupting running jobs.

100. How do you restart Jenkins safely?

Answer: Restart Jenkins safely by using the "Safe Restart" option, which waits for all running builds to
complete before restarting Jenkins. This ensures that no builds are interrupted, and the system restarts
in a controlled manner. The "Safe Restart" option can be triggered from the Jenkins UI or via a script.

Overview of the Pipelines

1. Tag-Based Pipeline:

Purpose: Runs tests based on tags associated with builds. This is useful for running specific test suites
related to a particular build or release.

Parameters:

- Build URL: The URL where the build artifacts are stored (Artifactory URL).

- Variant: Specifies the build variant for updating EPs.

- Scheduler: Defines the testbed, including SBC and PSX combinations.

- Scheduler Type: Indicates the environment type (Hardware, KVM, or Cloud).

- Tag: Runs all suites associated with the given tag.

- Tag Type: Defines the type of tag (A, B, or C) indicating SBC requirements.

- Notification: Recipients of job results via email.


2. Text File-Based Pipeline:

- Purpose: Executes tests based on suite names listed in a text file. This method is useful for
dynamically specifying test suites.

- Parameters: Similar to the tag-based pipeline but uses a text file to specify suite names
instead of tags.

3. Test Case-Based Pipeline:

- Purpose: Executes specific test cases and suites provided as input. This is useful for focused
testing of particular cases.

- Parameters: Allows for specifying individual test cases and suites to be executed.

Stages of the Pipeline

Checkout Build:

- Description: Checks out the code from the repository to the workspace.

- Details: This stage involves pulling the latest code or a specific version of the code that is
tagged for testing.

Execute Tests:

- Description: Runs the test cases or test suites as specified by the pipeline parameters.

- Details: This involves invoking the test execution scripts or tools with the test cases/suites as
inputs.

Regression Cases:

- Description: Executes regression test cases to ensure that new changes do not affect existing
functionality.

- Details: This stage is critical for validating that recent changes haven't introduced regressions.

Run Tests:

- Description: Final stage where all specified tests are executed.

- Details: This could involve running a comprehensive set of tests to validate the overall build.
Maintaining the Pipeline

- Version Control: The Jenkinsfile for each pipeline is maintained in version control (e.g., Git).
This ensures that changes to the pipeline scripts are tracked and can be rolled back if necessary.

- Parameter Management: Parameters are managed to ensure they are updated as needed.
For example, updating tag types or test case lists might require modifying the pipeline parameters or
input files.

- Monitoring and Alerts: Monitoring the pipeline execution and setting up alerts helps to catch
issues early. Jenkins provides logs and build statuses which are useful for diagnosing and resolving
problems.

- Documentation: Maintaining clear documentation for each pipeline, including parameters


and stages, helps in understanding and troubleshooting the pipeline. It also aids new team members
in getting up to speed.

Technologies Used

- Jenkins: The primary CI/CD tool used for orchestrating the pipeline stages. Jenkins handles
the execution of the stages, parameter management, and integration with other tools.

- Artifactory: Used for storing and retrieving build artifacts. The build URL parameter specifies
where the artifacts are located.

- Perl Script: Executes specific operations or test cases as part of the pipeline. This could be
used for custom test execution or reporting.

- Database Queries: Might be used for retrieving test data or validating results during the test
execution.

- Configuration Files: Config files created or updated by the pipeline to manage test parameters
and environments.

Example Explanation in an Interview


Interviewer: "Can you explain your approach to managing Jenkins pipelines for different testing
scenarios?"

Sourav: "Certainly. I manage three types of Jenkins pipelines: tag-based, text file-based, and test case-
based. Each pipeline is designed to cater to different testing needs:

- Tag-Based Pipeline: This pipeline is used for running tests associated with specific tags related
to builds. Parameters like Build URL, Variant, and Tag help in identifying which test suites to run based
on the build release.
- Text File-Based Pipeline: For scenarios where test suites are dynamically specified in a text
file, this pipeline reads suite names from the file and executes them accordingly.

- Test Case-Based Pipeline: This pipeline allows for focused testing by specifying individual test
cases. It provides flexibility for detailed testing of specific cases.

Each pipeline follows a structured approach with four main stages: Checkout Build, Execute Tests,
Regression Cases, and Run Tests. These stages ensure that we pull the latest code, run the necessary
tests, validate for regressions, and execute comprehensive testing.

To maintain these pipelines, I use version control to manage changes, monitor execution through
Jenkins logs, and ensure proper documentation for clarity. Technologies like Jenkins, Artifactory, and
custom scripts play a crucial role in the pipeline's operation."

You might also like