Jenkins QA
Table of contents
- 1] Agile
- 2] Waterfall
- 2] What is jenkins and why jenkins
- 3] Pre-requisite for jenkins
- 4] Default path for jenkins home directory
- 5] Significance of jenkins home directory
- 6] Is it possible to change the default path
- 7] Plugin
- 8] How do you troubleshoot jenkins
- 9] What is your approach when master server goes down
- 10] Why there will be 0 executers in master node
- 11] Tools used for Dynamic Testing
- 12] what is safe restart, how do you safe restart jenkins
- 13] You have one master and you have connected 5 slaves, what if the master goes down, how will you handle this situation
- 14] What is the use case of multibranch pipeline in jenkins
1] Agile
Its a software development methodology which promotes shorter development life cycles and where there is a feedback loop that prioritizes the customer feedback and changes the need to be made according to it
Plan -> Design -> Develop-> Test -> Deploy -> Review -> Launch . This cycle keeps on repeating after receiving feedback from customers end
Transparency
Predictable cost and Schedue
Allows for change
Improves Quality
2] Waterfall
it is used for that projects that are very small and for the projects that have no uncertain requirments
Requirments -> Design -> Implementation -> Testing -> deployment -> Maintained
Easy to manage
Works for smaller projents
Clearly defined stages
Well documented
AGILE | WATERFALL Model | |
Life Cycle | It has multiple but shorter SDLC | it has a very longer SDLC with fixed phases |
Planning | planning is done for very short term | planning is done for a long term |
Requirements | all the requirement of the project are not clearly defined | clearly defined before the development begins |
Progress | the progress of the project is reviewed once every day | once every week |
Team | teams are self governing | it is directed from the top of a project hierarchy |
Emphasis | it focuses on delivery of business value to the customer/client | it focuses on implementing the requirements |
Goal | the aim is to deliver product features in sprint to consume/customer | to deliver a complete product only once it has been completed and gone through all the phases |
If u r developing a software where the markets need may change every time or audience may need to give u feedback then choose Agile
If u do not have any business profits in mind where u r working with NGO or government where your requirements have to be established then u can go ahead with Waterfall
2] What is jenkins and why jenkins
Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software.
It is written in Java
jenkins follow Groovy script
(Jenkins is a free open source continuous integration tool & automation server to monitor continuous integration & delivery.)
(It is known as an automated continuous delivery tool that helps to build & test the software with easy integration of changes to the system)
Also, it enables the developers to continuously check in their code & also analyse the post build actions
The automation testers can run their tests as soon as the new code is added or code is modified
Features of jenkins :
Free open source
Easy installation on various OS
Availability of wide range of plugins & their easy installation
Easy upgrades
Easy configuration setup
Extensible with the use of third party plugins
Build pipeline support
Rapid release cycle
Advantages of Jenkins :
Build failures are cached during the integration stages
Notifies the developers about build report status using LDPA mail server (Lightweight Directory Access Protocol)
Easy bug tracking
Maven release project is automated using simple steps
Automatic changes get updated in the build report with notification
Use cases :
Software build test
Sanity/Smoke/Regression test
Web/Data Scraping related jobs
General Purpose Automation
Code coverage measurement jobs
Reverse engineering jobs
Key decoding jobs & many other jobs where software automation is applicable
3] Pre-requisite for jenkins
Java application
A machine with: 256 MB of RAM, although more than 2 GB is recommended
10 GB of drive space
4] Default path for jenkins home directory
/var/lib/jenkins
5] Significance of jenkins home directory
Configuration Settings: The Jenkins home directory stores all the configuration settings for the Jenkins server. This includes global configurations, plugin settings, user configurations, job configurations, and more.
Data Persistence: It is where Jenkins stores all its data, including build logs, artifacts, workspaces, and historical data about jobs and builds. This data persistence is vital for Jenkins to maintain continuity and track the progress of projects over time.
Backup and Restore: Since the Jenkins home directory contains critical data and configurations, it is essential to regularly back up this directory. In case of server failure or data loss, having a backup of the Jenkins home directory allows for quick restoration of the Jenkins environment.
Customization and Extensions: Administrators can customize Jenkins by adding new plugins, tools, and configurations. These customizations are typically stored within the Jenkins home directory, making it easy to manage and maintain the server's functionality.
Security and Access Control: Access to the Jenkins home directory should be restricted to authorized users and administrators only. This helps maintain the security of sensitive data and prevents unauthorized changes to the Jenkins environment.
In summary, the Jenkins home directory plays a crucial role in storing configurations, data, customizations, and ensuring the overall functionality, security, and reliability of the Jenkins CI/CD server.
6] Is it possible to change the default path
Yes
7] Plugin
software that adds new functions to a host program without altering the host program
Blue Ocean
Docker
kubernetes
Terraform
Sonar Scanner
AWS
Thin Backup, Periodic Backup
high availability plugin
RBAC
Slack notification plugin
Gearman plugin --> supports extra slaves
8] How do you troubleshoot jenkins
Troubleshoot depends on the error that we come across
9] What is your approach when master server goes down
High Availability Pluggin
10] Why there will be 0 executers in master node
11] Tools used for Dynamic Testing
Black-box testing: This technique tests the software's functionality without delving into the internal workings of the software
JMeter
Valgrind
Selenium
12] what is safe restart, how do you safe restart jenkins
Jenkins will restart when no jobs are running (after all the jobs have completed their execution )
add "safeRestart" in front of jenkins url
13] You have one master and you have connected 5 slaves, what if the master goes down, how will you handle this situation
Handling a situation where the master node in a distributed system goes down depends on the specific architecture and tools in use. Here are some common approaches to handle this scenario:
High Availability Setup:
Implement a high availability (HA) setup where the master node is replicated or clustered with a standby or backup master node.
Use technologies like Kubernetes with multiple master nodes or database clustering solutions like Galera Cluster for databases such as MySQL.
Configure automatic failover mechanisms so that if the master node goes down, the standby node takes over automatically without manual intervention.
Load Balancing:
Use a load balancer to distribute traffic among multiple master nodes.
If one master node goes down, the load balancer redirects traffic to the remaining available master nodes.
This approach requires careful configuration to ensure that the load balancer is aware of the health of each master node and can route traffic accordingly.
Data Replication and Backup:
Implement data replication between the master and slave nodes.
If the master node goes down, promote one of the slave nodes to act as the new master.
Regularly backup data from the master node so that it can be restored if necessary.
Monitoring and Alerting:
Set up monitoring and alerting systems to detect when the master node goes down.
Use tools like Prometheus, Nagios, or DataDog to monitor system health and alert administrators or automated systems when issues occur.
Implement automated recovery scripts or procedures to handle failover and restoration tasks.
Manual Intervention:
In some cases, manual intervention may be required if automatic failover mechanisms are not in place or fail to work as expected.
Administrators can manually promote a slave node to act as the new master and restore services.
This approach is less desirable in production environments but can be used as a last resort if other methods are not available.
The specific strategy chosen will depend on factors such as the complexity of the system, the criticality of the services running on the master node, and the level of redundancy and automation required for failover and recovery.
14] What is the use case of multibranch pipeline in jenkins
The Multibranch Pipeline in Jenkins is designed for managing projects that have multiple branches, such as Git branches, and where each branch may have its own Jenkins pipeline configuration. Here are some common use cases for Multibranch Pipelines in Jenkins:
Managing Multiple Feature Branches: In software development workflows, teams often work on multiple feature branches simultaneously. Each feature branch may have its own development, testing, and deployment requirements. Multibranch Pipelines allow Jenkins to automatically detect new branches in a repository and create corresponding pipeline jobs for each branch. This makes it easier to manage and test changes in isolation before merging them into the main branch.
Continuous Integration (CI) for Branches: Multibranch Pipelines enable continuous integration for every branch in a repository. Jenkins can automatically trigger builds and tests for each branch whenever changes are pushed, allowing developers to catch integration issues early and ensure that each branch remains in a deployable state.
Branch-specific Deployment and Testing: With Multibranch Pipelines, you can define different deployment and testing strategies for each branch. For example, feature branches might deploy to separate development environments for testing, while the main branch deploys to a staging or production environment. This segregation helps maintain stability in production while allowing rapid development on feature branches.
Automatic Pipeline Configuration: Multibranch Pipelines automate the creation and configuration of pipeline jobs for new branches. When a new branch is created in the repository, Jenkins automatically detects it and creates a corresponding pipeline job based on the configured pipeline script (e.g., Jenkinsfile). This reduces manual overhead and ensures consistency in pipeline configurations across branches.
Branch-specific Notifications and Reporting: Jenkins can generate branch-specific build notifications and reports using Multibranch Pipelines. For example, you can configure Jenkins to send notifications to specific teams or individuals based on the status of builds on different branches. This helps teams stay informed about the progress and health of their respective branches.
Overall, Multibranch Pipelines in Jenkins provide a scalable and efficient way to manage complex projects with multiple branches, streamline CI/CD workflows, and promote collaboration among development teams working on different branches concurrently.