Original address: medium.com/edureka/dev… Author: Saurabh Kulshrestha Translator: CODING Daveopus

Q1: What is continuous integration?

I would suggest that you start with a minimal definition of continuous integration to answer this question. This is a development practice that requires developers to integrate code into a shared code base multiple times a day. Each code change is then validated by an automated build so that the team can detect problems early.

I suggest you explain how continuous integration has been implemented in your previous work, as shown in the following example:

In the figure above: 1. The developer will clone the code to a private workspace. 2. After coding, they commit their changes to a shared code base (version control repository). The CI server monitors the code repository and checks out changes as they occur. The CI server then extracts these changes for build, run unit, and integration testing. The CI server immediately informs the team whether the build was successful or not. If the build fails, the CI server will send an alarm to the team. The r&d team will solve the problem as soon as possible. 8. The process repeats itself.

Q2: Why do r&d teams need continuous integration of development and testing?

For this answer, you should focus on the need for continuous integration. I suggest you include the following explanation in your answer: Continuous integration of development and testing improves software quality and reduces delivery time by replacing traditional testing practices after all development is complete. It allows development teams to detect and locate problems early, since developers need to integrate code into the repository multiple times a day (or more frequently) and then automatically validate each integration.

Q3: What are the success factors of continuous integration?

At this point, you must mention the requirement of continuous integration by including the following points in your answer:

  • Maintain the code repository
  • Automated build
  • Let builds self-test
  • Everyone makes sure changes are committed to the baseline every day
  • Keep building fast
  • Test in a clone of the production environment
  • R&d teams have easy access to the latest deliverables
  • Everyone can see the results of the latest build
  • Automatic deployment

Q4: How do I migrate or copy Jenkins from one server to another?

I will do this by copying the Jobs directory from the old server to the new server. There are several ways to do this:

  • Jobs can be moved from one Jenkins server to another simply by copying the corresponding job directory.
  • Make a copy of the existing job by cloning the job directory with another name.
  • Rename an existing job by renaming the directory. Note that if you change the job name, you need to change all the jobs that try to call the renamed job.

Q5: How do I create backup and copy files in Jenkins?

The answer to this question is straightforward: Create a backup. All you need to do is periodically back up the JENKINS_HOME directory. This includes all build job configurations, slave node configurations, and build history. To create a Jenkins backup, simply copy this directory. You can also copy the Job directory or rename the directory.

Q6: How to configure Jenkins’ job?

The solution to this answer is to mention how to create a job in the first place: go to the Jenkins home page, select “New Job”, and then select “Build a free-style Software Project”. Then you can set the elements of this freestyle job:

  • Optional SCM, such as CVS or Subversion where the source code resides.
  • Triggers that control when Jenkins executes the build.
  • Some kind of build script that performs the actual work (Ant, Maven, shell scripts, batch files, etc.).
  • Optional steps to collect information from the build, such as archiving artifacts, documenting Javadoc, and test results.
  • Configure steps to notify other people/systems of build results, such as sending emails, instant messages, updating issue trackers, and so on.

Q7: List some useful plugins in Jenkins

Here are some important plugins:

  • Maven 2 project
  • Amazon EC2
  • HTML publisher
  • Copy artifact
  • Join
  • Green Balls

I find these to be the most useful plugins, and you can add others as you see fit. But be sure to mention the above plug-ins first, and then add your own.

Q8: How to ensure Jenkins’ safety?

  • Ensure that the Global Security configuration item is enabled.
  • Make sure Jenkins is integrated with the enterprise employee directory with the appropriate plug-ins.
  • Ensure that the permission access Settings for the project matrix are enabled.
  • Automate the permissions/privileges setting process in Jenkins with custom version control scripts.
  • Restricts physical access to Jenkins data/folders.
  • It is subject to regular safety audits.

Click to use CODING to experience DevOps’ full toolchain agile development