How to Install Jenkins on Windows, Mac and Create Your Freestyle Job in Jenkins. - Day 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so let me tell you one important story okay so when i have started my software testing career right i had nearly around three years experience and have never worked with jenkins before and this was the first time i've joined a very new company and the first task they have given me is to create a freestyle job and run our automation framework on that they were running this automation framework using command line before and they wanted to do it periodically they wanted to run it on every day at 11 am before i mean whenever we start our day right and uh trust me i was very confused at that time and i was just telling myself why i don't know jenkins i have three years experience as a software tester right and then i went to my one of my friend who was a developer and he said he also don't know at that point because uh uh jenkins is something which is basically related to an automation server right it's an automation server that we have discussed in the last video and uh sometimes in other companies you are working with uh you are working with very small companies where it doesn't require jenkins is not required automation servers are not required because we are running it uh manually most of the things okay but whenever you join a decent company right whenever you join a company product based company or sometimes a m and cs jenkins is very important so that's what i wanted to tell you that if you are a fresher even if you are a three years experience your five year tenure it doesn't matter this is one of the skills of ci cd that you should know okay and in this video i'm gonna explain you how to install jenkins on windows mac ubuntu is very simple so you can follow the same process and i'm gonna explain you one more important concept which is what exactly is a freestyle job and how to basically configure it okay so let's get started [Music] awesome uh so this is the agenda guys which is running uh installing jenkins and running a maven project which i think you have seen previously also similar project that you can run uh maven is a build tool right you can run your development projects also a very similar commands we have seen and we will basically understand what is freestyle job okay uh okay awesome so how do i install uh this jenkins on my windows machine so right now i'm in windows okay and if so what you need to do is just go to the jenkins dot io slash download okay and select your operating system for example if you are on mac now let me make it my little smaller myself a little smaller if you're a mac i think it is uh very straightforward you have to uh you have brew installed already bro is installer for a mac and uh you can basically fetch a jenkins lts which is the latest version and you can mention the version also if you want to i prefer using this lts okay uh so let me jump to my mac okay and i so i have already installed it because i was showing you the demo at the day one right so this is the command that you need to run let me show you again which is brew brew install i think this one right install thinking lts okay so this command you have to basically uh run and after you basically run this command right it will be automatically installed and uh you will see some of the options uh to configure the jenkins so that i will show you in the windows right now okay so let's do one thing okay so i have downloaded uh if you want to download for windows i think you go to just windows right and it will automatically download msi file okay you can just cancel it because i have already downloaded let's go one by one click on this uh welcome to the wizard you just have to click next i'm gonna explain uh i'm gonna use the same uh okay uh run as a local not recommended but you can do that as of now which is not uh port number 88 is fine test port okay green signal everything works great okay it's saying that i will be installing the java sdk uh jdk basically okay no problem uh there's no and click on install awesome uh so let's wait for a couple of seconds awesome so uh let's understand uh this concept which is basically what is freestyle job okay so you are seeing this dashboard right now in jenkins right and uh this is basically to create any kind of a new job this is for managing people this is build history manage jenkins which is very important uh most importantly all the global configuration or anything that you won't like to do with jenkins right it is here here are the couple of others like creating a views for example you can create a views for your developers you can we create a view for uh testers they have a different set of jobs right they want to run so you can have that differentiation here uh those things okay so let's understand what exactly is freestyle job first okay so freestyle basically means that improvised or unrestricted okay uh in a nutshell it's just a typical job that you run okay and uh it could it can be a simple command it can be a simple sending a report it can be a simple packaging of application it can be a simple running a selenium test case so freestyle can be anything okay pipeline whereas if you see a pipeline job it's basically a step-by-step process right here in freestyle we have here we have unrestricted uh steps that we want to run so so let me give you a very simple example uh so these are the steps uh in free styles right so steps like uh there will be in general information that you are adding which source course management you are using if you have a local source code available right now in our case it's local you can put and you can also fetch from the git also so that that you can mention here uh what is a trigger for example if you want to run it like 15 minutes after 15 minutes 10 minutes five minutes right you can do that middle morbid uh which is environment for example you want to add which library for example maven and cradle you want to add any environment variables that you would like to add you can mention there here this is build where you will mention right uh which command you want to run for example if it is a maven project you will be running maven clean test right and it's a if it is a gradle you can run grade and test something like this so those thing you can mention post bill action is basically what happens after you have uh if you have run the selenium report selenium project right you want to sell email you want to send email reports or you want to basically show some slack notification if you want to publish a html report you can mention in the post build action okay so let's uh do this in a live okay uh so this is the jenkins dashboard right now i'm looking uh so you can click on new item and let's do hello okay and this is the freestyle project that i'm doing uh i'll just click it okay uh and if you see same same thing right description hello to jenkins this is just a description and there are a couple of bunch of options you can do if it is a github rep project you can mention the url here you can discard the old builds if you want to you can throttle this and you can parameterize it which is very important for right uh you can add different parameters to the project for example suppose uh you want to run suppose you want to run a project where you will be mentioning url outside you want to pass it from jenkins right you can do that here so we'll understand this after uh in probably in day three or day four okay uh and we are not using any uh source code management you can if you are using it you need to mention the git uh repository and the username and password here okay so that it will automatically fetch the use uh the resp uh your repository from there you can trigger it for example you can do a build periodically uh if you have add five minutes if you want to run five minute ten minutes or anything that you would like to add you can do that i'll give you one website which is chrome tab dot guru here you can get the uh exact like when it will run right so you can change for example i'll just do this thing and it will say that it at 4 10 it will execute okay so it will tell you exactly so you can test it out your fields accordingly uh and wind environment we don't want build step we want we want to execute a windows shell right suppose right now but right now if you see our project uh so we can run a windows shell for a hello world so windows shell if you know we are just running it like a hello right i'm just saying a hello and in portable action you can publish html report you can do other things also but this is just a simple project right that we are creating so just click on save and click on builder now right and it will build the project for you and you will see hit here click on this green icon and here uh green basically means build is passing finish success and we have a hello okay so let's create uh the selenium project okay uh after this uh this will be again a freestyle project where we will add we will be adding the maven configurations awesome so uh this is a selenium project that we will be basically executing okay so let's uh i'm not able to type okay so this will be selenium project i'm just adding a description okay there's no uh source code management's none we don't want to trigger the build there's no environment we will basically add a top level maven target okay and here the basically how we want to run this project is basically clean test and there's a particular file uh command that we want to use okay give me one second awesome so uh what you need to do is uh go to configure okay so whenever so you can add any description like for example this is a selenium jenkins okay uh job okay whatever it is uh there is no source code management again just reiterating trigger we don't want uh trigger you can add also for example if you want to do it parallel uh if you want to do after so click on this question mark again and you'll see some of the examples that you can add for example you can do it like fifth after 15 minutes for example this will every 15 minutes right this will run every 15 minute let's copy this and uh just paste it here so your jenkins bill will be executed after 15 minutes okay paste let's do one thing instead of paste uh 15 minutes let me let's make it by two okay so it will say it will run on one zero five and uh the next will be will run for uh the same date i think it's just giving you some random example okay let's do it 10 minutes okay okay after 10 minutes it will drop uh let's do it five is five working yes five okay okay so we have we have done it periodically it will run after five minutes again right and uh let's go down down down down down down uh you can go directly like begin build build environment uh here we have added mvn and this is our basically goal that we want to run we want to clean the test we are basically running a single dot xml okay so uh you i have told you like you can download download the code from here let me show you there go to this uh yeah in the jenkins folder sdot live notes jenkin folder you can download this zip file uh one thing you need to modify is this this one which is basically your own uh chrome driver path uh exe is for windows right now i'm showing you on the mac uh which is basically a little different how you will download the chrome drivers go to this go to this website download accordingly first see which version you guys are using go to help section go to about chrome i'm using 94 so i will be using 94 so 94 uh download it you will see this link zip file for windows you can download this mac you can download this mac with the m1 chip which is different you can download this client linux you can download this after this uh just put them into a particular folder right for example you can put it here and replace that from here this directory okay so this is a simple text test case which we are running we are basically uh setting up the driver we are setting a chrome driver and here we are basically opening a test test test app of a lambda test and we are doing a couple of uh selenium work which is basically clicking some random icons and after that we are just quitting it that's it very simple right awesome yeah and uh so this is the command we need to use we need to basically say tell uh run the test of single dot uh xml okay which basically means uh we are if you see here we i have created one single text xml which basically runs this file right and what is this file this file i have explained you okay so you need to change these two things which is basically your directory that's it now uh move back to the jenkins go to advance here you just need to enter your pawn.xml file but where your palm.xml is there in mac it's here so i have set it up on mac similar thing that you can do on windows also and uh just uh that's it i mean and click on save okay two things which are still missing which is basically uh in your window especially sometimes uh what will happen is ambien is not installed which is maven right uh go to manage jenkins go to global tool configuration okay click on this and here click on add jtk and uh here click on add and enter your username password and save it okay go to oracle website create your use free username and password enter here and it will install jdk if you if you have not installed jdk that's uh this is just for that okay and uh how do you install maven maven is free to download without any link uh i mean without any credentials so go down you can go to maven installation add maven okay click on add maven just name anything for example mvn2 okay and if you see the test case is running since we have done it periodically right yeah okay uh make sure you click on this install automatically and click on save okay i have done it already so i'm not gonna do that i'll just click on leave okay and here we have added periodically now our configuration is done so you can directly click on build now and it will start executing it if you see it right and it will basically open this url and it will run the test cases and everything works fine now one more thing which is coming is html report you can see the html report right how you can basically configure it again you have to just go to dashboard and click on manage jenkins this is a plugin actually so you need to install one plugin click on installed and you will see i have installed one uh where it is html publisher yeah this one html publisher but if you don't see it uh just go to the available tab uh go to available tab and just search for this html you will see it okay click on it and install click on this install without restart and it will be automatically available and how to configure it with sorry very simple just click on this click on clone figure this is actually a post build action right after your build is done so this uh you can mention this directory where your test case uh results are coming so here they are coming at this folder i have named a test.html and this is coming right you can add more post build action like email notification so you need to configure the email provider and uh you can add like more possible actions like publish a genuit report and a couple of other options which we'll discuss after this okay so this was it uh this demo i have shown you on the mac similar it will work on the windows also uh here on windows uh similar things i have done configuration right and if you see selenium i have added uh none there is no trigger i have added here uh nbn same thing and here you can give the form.xml in post build action i have not added the html publisher so let me show you how you can add that again uh again same thing manage jenkins go to your plugins uh where it is plugins note this one plugins right go to uh install and go to available because it is not installed right and here available uh there you will see a uh where it is think a html publisher i have installed let me check html publisher where are you h h okay so i think it's not installed i have a label where is the search icon [Music] okay here it is a html completion right click on this install without restart and it will uh basically install it if you see right last one success everything works great go to uh again go to your job uh just add the configuration and where you will see the reports right you need to just enter the that thing like postal action uh html the publish html report add and here you need to add the same directory okay you'll see the reports okay so for example in mac uh in configuration i have added this or similar you can do in the windows right just need to enter this and what is the name of your file that you want to open and save similar action in windows also okay so i hope this is clear guys uh you are able to run your test cases you are able to understand what is freestyle uh how to install it and this was a quick time okay so let's uh similar thing we will be doing it with the docker which is very important to learn let's do it in the day three okay let me show you uh so this is a day three where we'll be learning with docker commands how to run the same jenkins and same job okay let's jump into the day three alright thanks a lot for watching i'll see you next video bye [Music]
Info
Channel: The Testing Academy
Views: 457
Rating: undefined out of 5
Keywords: install jenkins on, install jenkins on windows, install jenkins on mac, install jenkins on ubuntu, install jenkins on aws ec2 linux, install jenkins on linux, install jenkins on docker, install jenkins on mac using brew, jenkins tutorial step by step, jenkins tutorial for beginners, jenkins tutorial, jenkins tutorial for beginners linux, jenkins full tutorial, jenkins pipeline, jenkins complete tutorial, what is jenkins, jenkins in devops, learn jenkins from scratch, jenkins
Id: DMzlntzNmDQ
Channel Id: undefined
Length: 19min 8sec (1148 seconds)
Published: Mon Oct 25 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.