SETUP WINDOWS AGENT IN JENKINS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys when we work on genkins we need our projects to be executed on different asens or different machines to achieve the continuous integration and continuous fi so today we'll see how we can set off the ense in Windows machine let's see how we can set up Windows asent in genkins I have got a brand new windows 2022 machine as the agent file is a Java program we need Java to be installed first so let's see how we can install Java on the Windows machine so here search for download Java 11 just look for the first link from the oracle.com Java SC1 archive downloads so here we can see we have different versions of Java SE development kit available suppose I need this particular Java version 11.0.2 so for Windows machion we should go with the package this particular either you can go with this installer package b. exe or what you can do you can just download this package and use it so let me just download this package and I'll show you how we can set off the Java environment all this in Windows platform let's download this package for this you should have a login credentials with Oracle so for me uh let let me just uh put the password for this so as soon as you give the credential it will start downloading the jdk file here you can see the file is has now been downloaded so what we can do here let's go to the download folder so here you can see we have this jdk hen 11.07 right so let's archive this this is a j file let's unj this file extract all so the file has now unied now we can see we have another folder called jdk hyen 11.0.1 7 right let's copy this particular folder go to your uh C drive and here in the program files we need to create a folder and just name this folder as Java and paste the file whatever you have copied the entire folder over here now this folder jdk folder is having all the Java related packages right so what we need now we need to set off the environment variable so far we have just downloaded the Java if we go to the command prompt and search for the Java version and check whether we have any Java installed or not Java version so we can see here we don't have Java install Java is not recognized as an internal or external command so here now what we can do we have to set up the environment variable in Windows so how we can do let's search here just search for environment and you can see here edit the system environment variables click on this and we have this particular system properties available now we can see here we have this environment variable section right C C on this and we have the first part is user variable so first what we have to do we have to create one user variable over here let's click on the new button here and we have to give a variable name so the variable name should be Java uncore home and the value you have to put it the Java bin path the Java path where the Java is been kept right so in our case the Java has been kept under this particular path let's copy this path and paste it here okay now what you have to do in the system variable also we have to create a system variable the same name javore home so click on the new button here just give your name Java _ home and just paste the value whatever we have copied the entire Java path okay now what we have to do we have created system variable as well as the user variables for administrator so what we can do you can see here we have one path system variables will be there right so what we have to do we have to edit this path and here we need to add this environment variables whatever we have created let's create new and percentile Java _ form percenti and you have to provide the bin path where the Java execute cable will be there under this bin Java home directory SL bin right okay now just save Okay click now what we can do if we just go and check let's close this uh command front let's let's open another one and here if we do Java Ty version now we'll get the Java version which is installed so this is the Java version which we installed now what we did we installed the Java in Windows 2022 machine now let's go and set up the asent in genkins let's log to your genkin server once you log to the genkin server let's go to the manage genkins part so in manage Jenkins part you'll see here we have one option called noes and clouds click on this notes on clouds and here you can see what about the noes available we have the master node which is called buil-in node and one more agent available that is I have named it as asent hypen B9 which is nothing but a linox isent okay and you can see here it is offline so what we can do here we can just go ahead and create new node over here just click on this new node suppose I'll give a name it as wi ipen asent and click on this permanent agent create just give a descriptions suppose I'll give us Windows asent right now the number of executor Bas on your resource capacity you can just give the number of executors over here and this remote directory remote root directory so this is mandatory so what is the remote directory you have to give let's go to the Windows machine and here in the C drive what we can do we can just create a in the program files it's s you can create one folder or what you can do Under This C drive you can just create a folder and name it as as for your chenkin requirement suppose I'll give it as chins okay let's go to this folder and copy this path or C colon SL Jenkins right so what I can do here I can just write this here C colon Jenkins now this is the root directory I gave it just to give a label so label is the something which we need to write in our pipeline script if you are going to automate it this label will be required or you have to identify which agent is required for your project to run so based on the labels you have identify so give a name to it now usage use this node as much as possible and here the most important is the launch method in which method you do you want to connect to the asent right so I just want to connect the agent using the launch agent by connecting to the controller click on this and it will just ask for the custom working directory leave it and internal data directory by default it is remoting right and availability keep this agent online as much as possible so leave as it is whatever things available now let's go ahead and save this so here you can see as soon as we save we have one note created here but this node seems offline so now see now let's see how we can make it to online right click on this particular node or agent and you can see over here uh it is giving us few uh ways how we can run uh from agent command line that is for Unix for Windows so we are just focusing on the Windows part right so let's copy this particular command go to your Windows machine right on the command line from F let's go to your Jenkins directory okay so CD Jenkins and here let's download this agent. J file from this particular server okay jenin server we need to download this agent. jar file let's hit enter now if you see here uh see in the Jenkins folder we have this as. jar file is downloaded now what we can do let go ahead and get the other command to execute this asent copy and go to your command prom here past it here hit enter see now we can see the asent is connected to the jenin server right let's check it out if I go to the notes and see here we have this Windows exent which is now online right if I go to the dashboard you can see here uh here the wi isent has two executors and it will be now available to accept the bill to execute okay now we can see here uh if you see this particular logs right what is is the agent Port it is getting connected to 50,000 so where you have to set this asent Cod and uh and how we have to done that right so remember guys if you don't do this particular Port set up in Jenkins then you might get some errors while connecting to the agent so let me show you how you do that let's go to your genkins so in manage genkins you have to go to the security tab right in security tab if you just go a little down if you go just a little down you'll find here the asent part right and this asent you can see here you I have selected here the fixed and I have given a port number to 50,000 so similarly you can just click on the fixed and you have to give the port number 50,000 and make sure this port is wi listed on this particular chenin server right so after that you have to save this part after save now if you just try to connect to the asent whatever we just tried with this command and you'll see it will just get connected hope this is very clear how we can set up the Java in the windows how we can set off the windows asent in the genin server okay uh if you have any doubt or any concerns please do write me in the comment section below I'll try to answer your queries if you have not yet subscribed my Channel please do subscribe now thank you
Info
Channel: Ranjit Swain
Views: 5,547
Rating: undefined out of 5
Keywords:
Id: BT9MbgKvMAM
Channel Id: undefined
Length: 11min 48sec (708 seconds)
Published: Fri Oct 06 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.