Jenkins QA
Jenkins QA
or can you
talk about any CICD process that you have implemented?
A: In the current project we use the following tools orchestrated with Jenkins to
achieve CICD.
- Maven, Sonar, AppScan, ArgoCD, and Kubernetes
- Build Triggers: Jenkins can be configured to use the Git plugin, which allows
you to specify a Git repository and branch to build.
The plugin can be configured to automatically build when changes are
pushed to the repository.
- Webhooks: A webhook can be created in GitHub to notify Jenkins when
changes are pushed to the repository.
Jenkins can then automatically build the updated code. This can be set
up in the "Build Triggers" section of a job and in the GitHub repository settings.
```
Q: How to backup Jenkins?
A: Backing up Jenkins is a very easy process, there are multiple default and
configured files and folders in Jenkins that you might want to backup.
```
- Configuration: The `~/.jenkins` folder. You can use a tool like rsync to back
up the entire directory to another location.
- Jobs: Backup the Jenkins jobs by copying the jobs directory located in
JENKINS_HOME/jobs to another location.
- User Content: If you have added any custom content, such as build artifacts,
scripts, or job configurations, to the Jenkins environment, make sure to backup
those as well.
- Jenkins file: A shared Jenkins file can be used to define the build process
for multiple jobs, reducing duplication and making it easier to manage the build
process for multiple projects.
- Global Variables: Shared global variables can be defined and used across
multiple jobs, making it easier to manage common build parameters such as
version numbers, artifact repositories, and environment variables.
```
Q: can you use Jenkins to build applications with multiple programming
languages using different agents in different stages?
Jenkins supports multiple build agents, which can be used to run build jobs on
different platforms and with different configurations. By using different agents in
different stages of the build process, you can build applications with multiple
programming languages and ensure that the appropriate tools and libraries are
available for each language.
For example, you can use one agent for compiling Java code and another agent
for building a Node.js application. The agents can be configured to use different
operating systems, different versions of programming languages, and different
libraries and tools.
Jenkins also provides a wide range of plugins that can be used to support multiple
programming languages and build tools, making it easy to integrate different parts
of the build process and manage the dependencies required for each stage.
Overall, Jenkins is a flexible and powerful tool that can be used to build
applications with multiple programming languages and support different stages
of the build process.
- Connect to Jenkins: Connect to the Jenkins instance using the load balancer
endpoint or the public IP address of one of the instances in the autoscaling group.
By using an autoscaling group for Jenkins, you can ensure that you have the
appropriate number of instances available to handle the load on your build
processes, and that new instances can be added or removed automatically as
needed. This helps to ensure the reliability and scalability of your Jenkins
environment.
```
A: Log into the Jenkins master and navigate to Manage Jenkins > Manage Nodes
> New Node. Enter a name for the new node and select Permanent Agent.
Configure SSH and click on Launch.
When a Jenkins agent is launched using JNLP, it connects to the Jenkins master
and receives build tasks, which it then executes. The results of the build are then
sent back to the master and displayed in the Jenkins user interface.
Q: What are some of the common plugins that you use in Jenkins?
A: Be prepared for answer, you need to have at least 3-4 on top of your head, so
that interview feels you use Jenkins on a day-to-day basis.