freestyle project Jenkins Job
We will be creating a very basic job that will throw some output. So, let us begin. Creating and running a job on Jenkins is as follows
Step 1: Click on a new item, and then you will have a page on which you have to give your name to your job and choose ‘freestyle project’ or any other option according to your need and then click ‘ok’.
Step 2: After this, you will reach a page where you have different options(like build, build triggers, source code management) that help you manage your job.
Step 3: Now, we will give some description of our job.
Step 4: Now, you have to provide which source code management tool you are using since here we are not using anyone so will choose the ‘none’ option.
Step 5: After this, if you want to give some triggers then you can choose accordingly even Jenkins provides us scheduled triggers. And you can choose to build an environment also accordingly. But, here we are making a simple job, so we are not using any triggers and build environment options.
Step 6: In the build section we have an option ‘Execute Windows batch command’ by which we can write some command or code.
Step 7: Now, you can give the command according to your need.
Then click apply and save. So, your job is created.
Step 8: Now, we will run it for which click the ‘build now’ option and a building history will be created then click on it.
Step 9: Now, Click on console output, and you can see your output. Also, by console output, you can see whether your job is failed or successful.
By now we are over with the procedural part and Jenkins is installed on the machine. Lets us finally do discuss out the meaning of some terms listed as follows:
Console output- gives details on how/what it runs behind.
Run any job== build now.
The symbol of the sun means the success of your job.
The symbol of the cloud means the failure of your job.
The trigger means automatic run and also we can give a schedule in it.
Key Points to Remember:
- Since we know in open source we use git and GitHub and to do automation we have to make interact Jenkins with GitHub so you need plugins to do so. And the plugin is nothing other than a software program that adds some important features to the existing one. Why plugins? Jenkins knows how to clone from GitHub and integrate, but plugins give it a mind to understand various commands of git.
- Whenever a job is downloading a file/folder so that Jenkins has to provide a space and that space is known as workspace. Normally, we use Jenkins for job chaining.
- Job chaining– Connecting the jobs with each other that is whenever the earlier job will run fine then Jenkins will go to the next job. This is also known as a pipeline. For example- Suppose you have made 3 jobs in Jenkins and you want them to run when the earlier one completes. So, when Job1 has been run already then Job2 will run and then Job3. So to do this, copy earlier job in copy tab and from triggers choose ‘build after other projects’ option. Here, Job2 is upstream with respect to Job3 and downstream with respect to Job1.
- Install pipeline plugins to have a better view because by this we can visualize for upstream and downstream. By default, we can run only two jobs parallel in Jenkins. But we can also run more jobs parallel, and it depends on your RAM of OS.
FAQs On Jenkins
1. What Is Use of Jenkins?
Jenkins is a popular open-source automation server used mostly for software development’s continuous integration and delivery (CI/CD) processes.
2. Is Jenkins Software Tool
Yes, Jenkins is an software tool which is used for the implementation of continuous integration and continuous delivery (CI/CD) pipelines.
3. Jenkins Pipeline
DevOps professionals mostly work with pipelines because pipelines can automate the processes like building, testing, and deploying the application. Doing manually by UI takes lots of time and effort which will affect productivity. To know how to write CI/CD pipeline.
4. What is Jenkins Agent?
Jenkins agents are machines or containers where Jenkins jobs are executed. They can be on the same machine as the Jenkins controller or distributed across multiple machines.
Comments
Post a Comment