jenkins question

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

23. Differentiate between Bamboo and Jenkins

Bamboo Jenkins Commercial tool Open-source tool Dedicated development team Huge global community Comparatively more user friendly Less user-friendly Many built-in features and plugins Many plugins to perform different functions are available in the Atlassian marketplace.

6. What is "Continuous Integration" with reference to Jenkins

Continuous Integration is a development practice where the codes can be integrated into a shared repository. The practice uses automated verifications for the early detection of code problems. Continuous Integration triggers the build to find and identify bugs present in the code. It adds consistency to the build process. It's a means to build things faster and prevents broken code.

4. How do you install Jenkins

Follow the steps mentioned below to install Jenkins: Install Java Install Apache Tomcat Server Download Jenkins war File Deploy Jenkins war File

32. Let's say there is a broken build in the Jenkins project, then what can be done

Initially, you will have to open the console output where the broken builds are created and then figure out if there are any file changes that were missed. In case there are no issues found there, then you will need to update your local workspace, replicate the problem, and then try to solve it.

22. Differentiate between Maven, Ant, and Jenkins.

Maven: 1-Build tool 2-Perform build operations ANT: 1-Build tool 2-Perform build operations Jenkins: 1- Continuous Integration tool 2- Jenkins may run unit tests and deploy applications

10. Name the three different types of pipelines in Jenkins

The three different types of Jenkins pipelines are: CI/CD pipeline Scripted pipeline Declarative pipeline

40. What are the three security mechanisms Jenkins uses to authenticate users

The three mechanisms are as follows: Jenkins uses an internal database to store user data and credentials. Jenkins can use a lightweight Directory Access Protocol (LDAP) server to authenticate users. We can configure Jenkins to employ the application server's authentication mechanism upon which we deploy it.

19. Assume that you have a pipeline. The first job that you performed was successful, but the second one failed. What would you do now

You don't have to worry, and you just have to restart the pipeline from the point where it failed by doing 'restart from stage.'

39. What do you understand by a trigger concerning a pipeline

A trigger is something that defines when and how the pipelines should be executed. There may be several triggers like a pull request trigger that is used to deploy a pull request, or there may be a stage trigger that is used in configuring how each stage in the release will be triggered.

3. What is Groovy in Jenkins

Apache Groovy is a dynamic object-oriented programming language used as a scripting language for Java platforms. Groovy is used to orchestrate the Jenkins pipeline and enables different teams to contribute to the work in different languages. Groovy's syntax is very similar to that of Java, making it more seamless with the Java interface. The language has several features like Java compatibility and Development support.

8. What is a CI/CD pipeline

CI/CD Pipeline or Continuous Integration/ Continuous Delivery is considered the DevOps approach's backbone. The pipeline is responsible for building codes, running tests, and deploying new software versions.

What are the differences between Continuous Integration, Continuous Delivery, and Continuous Deployment

Continuous Integration: Continuous Integration (CI) is a DevOps software development practice that permits developers to combine/merge the changes to their code in the central repository to run automated builds and tests Continuous Delivery: Continuous Delivery (CD) refers to the building, testing, and delivering improvements to the software code. The most critical part of the CD is that the code is always in a deployable state. Continuous Deployment: Continuous Deployment (CD) is the ultimate stage in the DevOps pipeline. It refers to automatic release of any developer changes from the repository to the production stage.

28. What is DSL Jenkins

DSL stands for Domain Specific Language. Jenkins job DSL is a plugin that allows us to define jobs in the programmatic form with minimal effort. You can describe your jobs in Jenkins using a Groovy Based Language. They designed Jenkins job DSL plugin to create versions of the job, manage the records

5. Which commands can be used to begin Jenkins

Here are the commands used to start Jenkins: Open the command prompt After the command prompt opens, browse to the directory where Jenkins war is present Then run the following command: D:\>Java -jar Jenkins.war

20. Explain the process in which Jenkins works

Here's the process in which Jenkins works: Jenkins checks changes in repositories regularly, and developers must secure their code regularly. Once the changes are defined, Jenkins detects them and uses them to prepare a new build. After that, Jenkins will transverse through various stages in its usual pipeline. As one stage completes, the process will move further on to the next stage. If a stage fails, the Jenkins build will stop there, and the software will email the team using it. When completed successfully, the code implements itself in the proper server so that testing begins. After the successful testing phase, Jenkins shares the results with the team using it.

16. How can you deploy a custom build of a core plugin

If you wish to deploy a custom build of a core plugin, you follow the following steps: Stop Jenkins Then copy the custom HPI to $Jenkins_Home/plugins After that, delete the previously expanded plugin directory Next, make an empty file called <plugin>.hpi.pinned Finally, start Jenkins

35. How can the parameters be defined in Jenkins

In Jenkins, a build can take many input parameters to execute. To define parameters for the job, select the "this project is parameterized" box. The drop down "Add Parameter" is enabled with the parameter types list. Any number of parameters may be added in the list. There are several parameter types provided in the list.

37. What is the use of the JENKINS_HOME directory

JENKINS_HOME directory is the place where all the settings, logs, and configurations are stored. It stores all this information in XML files. The directory contains a subdirectory for every Jenkins build job being operated. Every directory has two subdirectories: builds and workspace., and some other files as well. These sub directories are important, as the workspace directory is located at the place where Jenkins is building the project, and it contains the source code. The builds directory stores the history of all the builds performed for this job.

21. What is Jenkinsfile

Jenkins file is a text file that has a definition of a Jenkins pipeline and is checked into the source control repository. It enables code review and iteration on the pipeline. It also permits an audit trail for the pipeline.

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 //token for github push Project1 / CI/CD through Jenkins -create 2 servers on AWS username: dubois password:Pourquoi2026$ 1 jenkins server and 1 webser https://github.com/aristidejou/hello-world.git go to http://@ipjenkins:8080/configureTools/ install maven On Jenkins Create a new job , Maven project ,git , put the repository (add credential if the repository is private),master branch, pom.xml(from maven),goal(clean install package) apply & save. Build the pipeline and if green CI pipeline is good On Webserver (tar xf ...tar.gz) Install apache tomcat server Check if it is installed $ ps -ef | grep tomcat Go to /conf/server.xml Check the port number and add the rule in AWS Manage Jenkins / to install some plugin like deploy to container Credentials -> Jenkins -> add credentials -> check /opt/tomcat/latest/conf/tomcat-users.xml <user username="ovidi" password="ovidi" roles="manager-script"/> On Jenkins Configure -> build -> post-build ->deploy war/ear ->**/*.war Containers-> tomcat number Tomcat url : @ip:port/ Apply and save Build and when turn green check your browser @ip:port/webapp Configure->build triggers->build whenever a snapshot ->poll SCM Schedule */2 * * * * this is every two minutes do the job Min hour day month day-week After every 2min Jenkins will check if something have changed and apply it and build by himself. To modify the index file you can use github , git or *****************************Installation de tomcat sudo apt update sudo apt install default-jdk sudo useradd -r -m -U -d /opt/tomcat -s /bin/false tomcat wget lien.tar.gz tar xf apache-tomcat-9.0.64.tar.gz mv apache-tomcat-9.0.64 /opt/tomcat/ sudo ln -s /opt/tomcat/apache-tomcat-9.0.27 /opt/tomcat/latest sudo chown -RH tomcat: /opt/tomcat/latest sudo sh -c 'chmod +x /opt/tomcat/latest/bin/*.sh' sudo vi /etc/systemd/system/tomcat.service ************************************************** [Unit] Description=Tomcat 9 servlet container After=network.target [Service] Type=forking User=tomcat Group=tomcat Environment="JAVA_HOME=/usr/lib/jvm/default-java" Environment="JAVA_OPTS=-Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true" Environment="CATALINA_BASE=/opt/tomcat/latest" Environment="CATALINA_HOME=/opt/tomcat/latest" Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid" Environment="CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC" ExecStart=/opt/tomcat/latest/bin/startup.sh ExecStop=/opt/tomcat/latest/bin/shutdown.sh [Install] WantedBy=multi-user.target sudo systemctl daemon-reload sudo systemctl start tomcat sudo systemctl status tomcat sudo systemctl enable tomcat sudo ufw allow 8080/tcp sudo vi /opt/tomcat/latest/conf/tomcat-users.xml <tomcat-users> <!-- Comments --> <role rolename="admin-gui"/> <role rolename="manager-gui"/> <user username="admin" password="admin_password" roles="admin-gui,manager-gui"/> </tomcat-users> sudo vi /opt/tomcat/latest/webapps/manager/META-INF/context.xml <Context antiResourceLocking="false" privileged="true" > <!-- <Valve className="org.apache.catalina.valves.RemoteAddrValve" allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" /> --> </Context> sudo systemctl restart tomcat Open your browser and type: http://<your_domain_or_IP_address>:8080 Project1------https://github.com/aristidejou/hello-world.git On Jenkins server Create new job , maven project ,git , repository ,build( pom.xml, clean install package) apply and save. Build now (green means good and red means bad) To deploy On the webserver(tomcat server ) Devops flow 1-continuous development Source code management : git , bitbucket , mercurial, perforce , subversion 2- continuous integration Jenkins, Bamboo , circleci , Teamcity Setps: Unit testing: Junit , Nunit Code Build: Maven , Ant , Gradle Code Analysis: Veracode, SonarQube Code Artifacts : Nexus , Artifactory 3- continuous deployment Ansible, urban code, Jenkins , puppet , aws codedeploy Infrastructure: CD needs target test = docker, Kubernetes, data center , aws , azure Configuration Management :ansible, chef , puppet 4- continuous testing: Selinium ,Apache Jmeter ,Tricentis 5- continuous monitoring Nagios , Zabbix , Prometheus 1. What is Jenkins

Jenkins is an open-source free automation tool used to build and test software projects. The tool makes it painless for developers to integrate changes to the project. Jenkins' primary focus is to keep track of the version control system and initiate and monitor a build system if there are any changes. It keeps an eye on the entire process and provides reports and notifications to alert. Some typical reasons as to why Jenkins is so widely used are: Developers and testers use Jenkins to detect defects in the software development lifecycle and automate the testing of builds. They use it to continuously monitor the code in real-time and integrate changes into the build. Jenkins as it turns out, is a great fit for building a CI/CD pipeline because of its plugin-capabilities, and simple-to-use nature.

15. How can you create a backup and copy files in Jenkins

Jenkins stores all the settings, builds scripts, and logs in the home directory. Then, if you want to create a backup of this Jenkins set up all you have to do is copy this directory. The job directory may also be copied to clone a job or rename the directory. Intermediate Level Jenkins Interview Questions

27. Explain Kubernetes, and how can you integrate Jenkins with Kubernetes

Kubernetes is a portable and open-source platform that is used for managing workloads and services that are containerized. With the help of Kubernetes, the group of hosts running the Linux containers can be easily and efficiently managed. To manage a Continuous Delivery (CD) pipeline, the most efficient way is to deploy Jenkins with Kubernetes Engine. Kubernetes enables the creation of multiple container instances to satisfy more fault tolerance. Kubernetes deploy plug may be used with Jenkins for Continuous Deployment.

31. What are some of the critical aspects of the Jenkins pipeline

Some of the Jenkins Pipeline key aspects are: Pipeline: User-defined model of a CD pipeline. Pipeline's code takes the role of defining the entire build process, including building, testing, and delivering an application. Node: A machine as a part of the Jenkins environment which is capable of executing a pipeline. Step: An individual task that communicates to Jenkins about what to do at a particular point in time Stage: This defines distinct subset of tasks that are conceptually unique and performed through the pipeline (build, test, deploy stages)

30. What are some of the default environmental variables in Jenkins

Some of the Jenkins environmental variables are: $JOB_NAME - The name that you give your job when it is first set up. $NODE_NAME - This is the name of the node on which the current build is running. $WORKSPACE - Refers to the path of the workspace $BUILD_URL - Indicates the URL where the results of the builds can be found. $JENKINS_URL - This is set to the URL of the Jenkins master that is responsible for running the build.

2. What are the features of Jenkins

Some of the crucial features of Jenkins are the following: It is a free and open-source automation tool Jenkins provides a vast number of plugins It is easy to set up and install on multiple operating systems Provides pipeline support Fast release cycles Easy upgrades

9. What is a Jenkins pipeline

The pipeline represents the continuous delivery and continuous integration of all the jobs in the SDLC and DevOps life cycle. The Jenkins pipeline is a set of plugins that support implementation and integration of continuous delivery pipelines into Jenkins. It connects this pipeline in a particular format by Jenkins. The Jenkins pipeline solves several problems like the maintenance of thousands of jobs and maintaining deployment with needing to resort to other powerful methods.

29. What is the process to configure Third-party tools in Jenkins

The process to configure Third-party tools in Jenkins can be seen in four significant steps: Install the third-party software Then install a Jenkins plugin supporting the third-party tool Now, configure the tool from the Manage Jenkins section Finally, your plugin is ready to be used

33. How to deploy a custom build of a core plugin

The steps to deploy a custom build of a core plugin are: First, copy the .hpi file to $JENKINS_HOME/plugins Then remove the plugin's development directory Next, create an empty file called <plugin>.hpi.pinned Finally, restart Jenkins and use your custom build of a core plugin

17. What could be the steps to move or copy Jenkins from one server to another

There are multiple ways to move or copy Jenkins from one server to another: You may move a job from one Jenkins installation to another just by copying the corresponding job directory. You may make a copy of an already existing job by making a clone of the job directory with an uncommon name. You may also just rename a current job by renaming a directory.

36. Explain the ways to configure Jenkins node agent to communicate with Jenkins master

There are two ways to configure Jenkins node agent to communicate with Jenkins master: Browser-If we launch the Jenkins node agent from a browser, a Java Web Start or JNLP file is downloaded. The downloaded file launches a new process on the client machine to run jobs. Command-line-If you want to start the node agent using the command line, you need the executable agent.jar file. When this file runs, it launches a client's process to communicate with the Jenkins master to run build jobs.

34. What is the process of making a Multibranch Pipeline in Jenkins

To create a Multibranch Pipeline in Jenkins, follow the following steps: Open the Jenkins dashboard and create a new item by clicking on 'new item' Enter the project name and, from the options, select 'Multibranch pipeline' Click on OK Then select the repository location, branch source (GitHub/Bitbucket), and add the branch source credentials. Save the project Now, Jenkins automatically creates new Multibranch Pipelines for repositories Then to connect to the GitHub repo, we need the HookURL To get this URL from the repository settings, add this HookURL to the Webhooks section Once the jobs are created, Jenkins will automatically trigger the build

26. What is the process to integrate Git with Jenkins

To integrate Git with Jenkins, you can follow the following steps: First, create a new Jenkins job and open the Jenkins dashboard. Now, enter the desired project name and select the job type. Click on OK. Then enter the project information. After that, visit the 'Source Code Management' tab. If the Git plugin is pre-installed in Jenkins, there will be 'Git'. If it is not installed, you must reinstall the plugins (GitHub plugin, GitHub Branch Source plugin, GitHub API plugin, Git client plugin, etc.). After we install the plugins, restart Jenkins. To check if Git is installed, you can go to Command Prompt and type Git, and you would see various options like usage, version, help, etc.

11. How can you set up a Jenkins job

To set up a Jenkins job, you may follow these steps: Select New item from the menu Next, enter a name for the job and select a free-style job Click on OK to create a new job Hence, the next page that appears will allow you to configure your job.

12. What are the requirements for using Jenkins

To use Jenkins, you require the following: A source code repository that can be accessed, for example, a Git repository. A build script, for example, a Maven script.

25. Why is Jenkins used with Selenium

Using Selenium allows Jenkins's testing whenever there are any software changes or any changes in the environment. When the Selenium test suite is integrated with Jenkins, the testing part is also automated as part of the build process.


Ensembles d'études connexes

A&P of Speech SPTH 5570; Anatomy of Respiration C: Muscles of Respiration; Created 2-18-15; Dr. Gibson

View Set

Intro to Social Research - Exam 2

View Set

Chapter 5: Texas Statues and Rules Common to Life and Health Insurance

View Set