Jenkins Flashcards
What is Jenkins?
Jenkins is a cross-platform, continuous integration and continuous delivery application that increases your productivity. Use Jenkins to build and test your software projects continuously making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. It also allows you to continuously deliver your software by providing powerful ways to define your build pipelines and integrating with a large number of testing and deployment technologies.
Jenkins is an open source tool with plugin built for continuous integration purpose. The principle functionality of Jenkins is to keep a track of version control system and to initiate and monitor a build system if changes occur. It monitors the whole process and provides reports and notifications to alert.
What is continous integration?
Continuous integration (CI) is a software engineering practice in which isolated changes are immediately tested and reported on when they are added to a larger code base. The goal of CI is to provide rapid feedback so that if a defect is introduced into the code base, it can be identified and corrected as soon as possible. Continuous integration software tools can be used to automate the testing and build a document trail.
In software development, when multiple developers or teams are working on different segments of same web application, we need to perform integration test by integrating all modules. In order to do that an automated process for each piece of code is performed on daily bases so that all your code get tested.
What is the requirement for using Jenkins?
To use Jenkins you require:
•A source code repository which is accessible, for instance, a Git repository
•A working build script, e.g., a Maven script, checked into the repository
Jenkins is a Continuous Integration and Deployment tool. Now a days, client is interested in Agile methodology in which everything should be automated. What Exactly jenkins will do is Jenkins will continously monitor the Git, SVN etc., and If it finds any new change, then it will initiate a build using Maven or Ant and if the build is success then it will deploy it on either on-premise or cloud. If the build is failed, then it will trigger a descriptive mail stating the reason for failure.
What are the advantages of using Jenkins?
Jenkins is a Continuous Integration server.
Basically Continuous Integration is the practice of running your tests on a non-developer machine automatically everytime someone pushes new code into the source repository.
This has the tremendous advantage of always knowing if all tests work and getting fast feedback. The fast feedback is important so you always know right after you broke the build (introduced changes that made either the compile/build cycle or the tests fail) what you did that failed and how to revert it.
If you only run your tests occasionally the problem is that a lot of code changes may have happened since the last time and it is rather hard to figure out which change introduced the problem. When it is run automatically on every push then it is always pretty obvious what and who introduced the problem.
Built on top of Continuous Integration are Continuous Deployment/Delivery where after a successful test run your instantly and automatically release the latest version of your codebase. Makes deployment a non-issue and helps you speed up your development.
“Advantage of Jenkins include
•At integration stage, build failures are cached
•For each code commit changes an automatic build report notification generates
•To notify developers about build report success or failure, it is integrated with LDAP mail server
•Achieves continuous integration agile development and test driven development
•With simple steps, maven release project is automated
•Easy tracking of bugs at early stage in development environment than production
“
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
• java -jar jenkins.war –httpPort=9090”
What are some of the useful plugins for Jenkins?
"Some of the important plugins in Jenkin includes •Maven 2 project •Amazon EC2 •HTML publisher •Copy artifact •Join •Green Balls
How can you create a backup of files in your Jenkins server?
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.
How do you create a 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.
What is a build trigger?
“A build trigger tells Jenkins when to execute the job. Some build triggers include:
◦Start a build job once another build job has completed
◦Kick off builds at periodical intervals
◦Poll the SCM (Git, SVN, etc.) for changes
“
What is a pre-build and post-build step? What can you do in these steps?
“Pre-build and post-build steps include executing Windows batch commands, executing top-level Maven targets, etc. before and after a job is started or completed.
“
What components are Jenkins usually integrated with?
“Jenkin is mainly integrated with two components
•Version Control system like GIT, SVN
•And build tools like Apache Maven.
“