Here we have compiled the most probable DevOps interview questions asked in the industry. You will learn about software version control, Git repository, reverting a commit in Git, Vagrant, continuous testing elements, and the importance of continuous integration, testing, and deployment. These questions are curated after discussing with many interviewers and DevOps Training experts.
Agent is a physical or cloud environment that is controlled by Jenkins master and assigns jobs to execute. This is a master-slave architecture, where a slave is an agent.
Here are the steps to schedule Build Periodically jobs in Jenkins
1. Go into the Job and click on the "Configure" option in the left panel.
2. Scroll down to "Build Triggers" and click on the checkbox of "Build Periodically" and set a value in cron syntax.
Groovy is the default scripting language that is used in writing pipeline scripts.
Jenkins GUI keeps the last 30 builds of each job. But actually Jenkins stores all builds and logs in disk. You can access those using the build number in url. It is suggested to remove old builds to save disk space. You can set "how many days the build should be kept in jenkins" and "how many builds to keep". But some companies suggest keeping 60 builds of each job in jenkins.
Jenkins GUI keeps the last 30 builds of each job. But actually Jenkins stores all builds and logs in disk. Jenkins has a feature to remove old builds, in order to save disk space. We can set a number of builds to keep in the General setting of Job. So log rotation depends on your configuration.
Maven is a Build Automation tool mainly used for java projects and also compatible for other projects such as project written in C# and Ruby etc. Maven downloads project dependent libraries from the central repository Maven2 and keeps in ".M2" Directory in the "$userhome". By this you came to know Maven manages project builds and its dependencies as well. Maven keeps all key information about the project in the POM.xml file.
Yes, Maven works as a build tool for mainly java code. And these are the phases involved in the maven life cycle.
Validate - It is the initial step where it validates the project and all necessary information is available or not.
Compile - In this step, the Project source code is Compiled.
Test - During this step compiled source code is tested using a suitable builtin unit test framework.
Package - In this step the Compiled code packaged in its distributable format such as JAR/WAR/EAR.
Integration Test - Deploys the package into an environment, where integration tests can be run.
Verify - Verifies the result package of the integration test is valid, it has to meet quality criteria.
Install - It will install the package into local repository, for use as a dependency in other projects locally.
Deploy - In this Step it copies the final package to the remote repository for sharing with other developers and Projects.
POM (Project Object Model), is the fundamental unit in maven, it is written in XML which has all the key information about the project’s Configuration, which is needed to build the project. And the pom.xml file will be in the project's source directory.
Maven Plugins are used for:
|Ant is a toolBox||Maven is a Framework.|
|Ant is flexible with configurations||Maven has conventions.|
|Ant is having Procedural Approach, it takes a long xml build script.||Maven is Declarative, enough declaring the requirements in pom.xml.|
|Ant does not have any Life Cycle.||Maven has a Life Cycle.|
|Ant Scripts are not reusable||Maven scripts are reusable with little modifications.|
2023 Gamut Gurus Pvt Ltd, All rights Reserved.