Jenkinsdafd 34
Jenkinsdafd 34
Jenkinsdafd 34
Answer: Jenkins is a free open source Continuous Integration tool and automation server to monitor
continuous integration and delivery. It is written in Java.
It is known as an automated Continuous Delivery tool that helps to build and test the software
system with easy integration of changes to the system. Jenkins follows Groovy Scripting.
Also, it enables developers to continuously check in their code and also analyze the post-build
actions. The automation testers can use to run their tests as soon as the new code is added or code
is modified.
Answer: Jenkins is used to continuously monitor the large code base in real time. It enables
developers to find bugs in their code and fix. Email notifications are made to the developers
regarding their check-ins as a post-build action.
Gits
Maven 2 Project
HTML Publisher
Copy Artcraft
Join
Green Balls
Amazon EC2
Answer: Continuous integration is the process of continuously checking-in the developer’s code into
a version control system and triggering the build to check and identify bugs in the written code.
This is a very quick process and also gives them a chance to fix the bugs. Jenkins is one such
continuous integration tool.
While performing integration testing all the modules are being integrated together. It is considered
as the development practice to integrate the code into the source repository
Whenever the programmer/developer makes any change to the current code, then it automatically
gets integrated with the system running on the tester’s machine and makes the testing task easy and
speedy for the system testers.
Answer: There is no difference between Hudson and Jenkins. Hudson was the former name of
Jenkins, after going through several issues the name was changed to Jenkins.
Answer: Groovy is the default scripting language that is being used in development from JMeter
Version 3.1.
Currently Apache Groovy is the dynamic object-oriented programming language that is used as a
scripting language for the Java platform. Apache Groovy comes with some useful features such as
Java Compatibility and Development Support.
Answer: You can follow the below mentioned steps to start Jenkins:
Q #10) What is the difference between Continuous Integration, Continuous Delivery, and
Continuous Deployment?
Answer: The diagrammatic representation given below can elaborate on the differences between
Continuous Integration, Continuous Delivery, and Continuous Deployment more precisely.
Continuous Integration:
(Involves keeping the latest copy of the source code at a commonly shared hub where all the
developers can check to fetch out the latest change in order to avoid conflict)
Continuous Delivery:
Continuous Deployment:
Answer: The pipeline can be defined as the suite of plugins supporting implementation and
integration of continuous delivery pipelines in Jenkins.
Continuous integration or continuous delivery pipeline consists of build, deploy, test, release
pipeline. The pipeline feature saves a lot of time and error in maintaining the builds. Basically, a
pipeline is a group of build jobs that are chained and integrated in sequence.
In the above syntax, the node is a part of the Jenkins distributed mode architecture, where there
are two types of node Master which handle all the tasks in the development environment and
the Agent is being used to handle multiple tasks individually.
Answer: Declarative Pipelines are the newest additions to Jenkins that simplify the groovy syntax of
Jenkins pipelines (top-level pipeline) with some exceptions, such as:
No semicolon to be used as a statement separator. The top-level pipeline should be enclosed within
block viz;
Answer:
CVS
Git
Perforce
AccuRev
Subversion
Clearcase
RTC
Mercurial
13. Jenkins
14. GitLab CI
15. Travis CI
16. CircleCI
17. Codeship
18. Go CD
19. TeamCity
20. Bamboo
Answer: You can use the following commands to start Jenkins manually:
Answer: Environmental Directives is the sequence which specifies pairs of the key-values called
Environmental Variables for the steps in the pipeline.
Answer: Trigger in Jenkins defines the way in which the pipeline should be executed
frequently. PollSCM, Cron, etc are the currently available Triggers.
Answer: The Agent is the section that specifies the execution point for the entire pipeline or any
specific stage in the pipeline. This section is being specified at the top-level inside the
pipeline block.
Q #20) How to make sure that your project build does not break in Jenkins?
Answer: You need to follow the below-mentioned steps to make sure that the Project build does not
break:
23. Clean and successful installation of Jenkins on your local machine with all unit tests.
24. All code changes are reflected successfully.
25. Checking for repository synchronization to make sure that all the differences and changes
related to config and other settings are saved in the repository.
Maven is a build tool like Ant. It consists of a pom.xml file which is specified in Jenkins to run the
code. Whereas, Jenkins is used as a continuous integration tool and automate the deployment
process. The reports of the builds can be used to set a mark for continuous delivery as well.
We will review the differences between Maven, Ant, and Jenkins in a comparative way:
Answer: Post is a section that contains several additional steps which might execute after
the completion of the pipeline. The execution of all the steps within the condition block
depends upon the completion status of the pipeline.
The condition block includes the following conditions – changed success, always, failure, unstable
and aborted.
Answer: Parameters are supported by Agent section and are used to support various use-cases
pipelines. Parameters are defined at the top-level of the pipeline or inside an
individual stage directive.
Answer:
Step 1: Go to the Jenkins Dashboard and Login with your registered login credentials.
Step 2: Click on the New Item that is shown in the left panel of the page.
Step 3: Click on the Freestyle Project from the given list on the upcoming page and specify
the item name in the text box.
Step 4: Add the URL to Git Repository.
Step 5: Go to the Build section and click on the Add build step => Execute Windows batch
command.
Step 6: Enter the command in the command window as shown below.
Step 7: After saving all the settings and changes click on Build Now.
Answer: To create a clone repository via Jenkins you need to use your login credentials in the Jenkins
System.
To achieve the same you need to enter the Jenkins job directory and execute the git config
command.
Answer: Securing Jenkins is a little lengthy process, and there are two aspects of securing Jenkins:
(i) Access Control which includes authenticating users and giving them an appropriate set of
permissions, which can be done in 2 ways.
It consists of all the job configurations and slave node configurations. Hence, regularly copying this
directory allows us to keep a backup of Jenkins.
You can maintain a separate backfile and copy it whenever you need the same. If you want to copy
the Jenkins job, then you can do so by simply replicating the job directory.
Q #29) What is the use of Backup Plugin in Jenkins? How to use it?
Answer: Jenkins Backup Plugin is used to back up the critical configurations and settings in order to
use them in the future in case of any failure or as per the need of time.
The following steps are followed for backing up your settings by using the Backup Plugin.
Step 4: Once you choose the available option, it will start installing.
Step 5: Once it is installed the following screen will appear, from there choose Settings.
Step 6: Enter the necessary details like backup directory along with other options as shown on the
below screen and save the settings. The backup will be saved to the specified Backup Directory.
Step 7: Go to the previous page to test whether the backup is happening or not by clicking on
Backup Now as shown in the below image.
Step 8: At last you can check the Backup Directory specified in the ThinBackup Settings.
Q #31) What is the solution if you find a broken build for your project?
(i) Open console output for the build and check if any file change has missed.
OR
(ii) Clean and update your local workspace to replicate the problem on the local system and try to
resolve it (In case you couldn’t find out the issue in the console output).
Answer: For installing Jenkins you need the following system configuration:
Answer: The flowchart below shows the Continuous Delivery Workflow. Hope it will be much easier
to understand with visuals.
Q #34) What are the various ways in which the build can be scheduled in Jenkins?
Answer: We have seen the Continuous Delivery workflow in the previous question, now let's see the
step by step process of why Jenkins is being called as a Continuous Delivery Tool:
36. Developers work on their local environment for making changes in the source code and push
it into the code repository.
37. When a change is detected, Jenkins performs several tests and code standards to check
whether the changes are good to deploy or not.
38. Upon a successful build, it is being viewed by the developers.
39. Then the change is deployed manually on a staging environment where the client can have a
look at it.
40. When all the changes get approved by the developers, testers, and clients, the final outcome
is saved manually on the production server to be used by the end users of the product.
In this way, Jenkins follows a Continuous Delivery approach and is called the Continuous
Delivery Tool.