Integrate Jenkins with Bitbucket

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is a llama game and hope you're having a good time and today I'm creating this tutorial to demonstrate how to integrate Jenkins with bitbucket without having a static IP so you can use your home network to do that so we all know that Jenkins is a very popular continuous integration and continuous delivery platform open source it can skill and a lot of other interesting stuff so this can this tutorial is basically limited to the basic installation of the Jenkins creation of a CI job and integrating with bit buckets so that on each commit you will have a CI job running so let's start so like I said I will just go to what we will be doing throughout this session or the video tutorial if you are looking for something else you can go and find some other tutorials I will be creating couple of more online videos with talker on Jenkins persisting and other some different stuff but this is limited to this part these describe part only so you will be doing a basic installation of Jenkins we will install a bitbucket plugin on the junkies them then you are gonna create a CI job then we will use a cradle w clean build command into the CI job since I am using a springboard application to run the CI job to be ran into the CI job so I will be using the bit bucket and I will create a profile if you don't have it please create a profile and then after that we'll be using a web hook to notify Jenkins from the bait bucket and that something is first and then after that we will have our Jenkins running we will have our code set up and we will have our CI job set up we are gonna do the set up the modem to understand or receive the verbal connection from the bit bucket and this kind of trigger the CI job on each commit so let's get started so first of all you have to go to the jenkees dot IO and download section and what I will say - if you are gonna doing a basic in demonstration so you can download the bar file you can click here download it so just to save time I already downloaded that war file here dot wad just to notice there is nothing else in this territory just the war file and when we are going to run this for files then it will create the Jenkins home directive or here which will have all those Jenkins related stuff so the only prerequisite is is that you should have Java installed so this tutorial can pretty be pretty much run on any other platform like Mac or Windows so all you need it is it all you need to have is the Java installed I'll do it LS to see this is the Jenkins dot war and then I am gonna say Java - cha-ching start work so by default when you do it you can specify the port which port iran iran but by default it runs on port 8080 so i'm gonna be hit enter and after that i am waiting for a password which is initial admin parts or these grades here you go she's gonna copy this password and she is responding by default on port 8080 i'm gonna say like localhost colon 8080 hit enter getting ready just straight for some time so it's fully up and running so I'm gonna it's gonna really direct to put the admin password just in case if you forget your password you can find it here in Windows it's going to be a different directory so I'm gonna hit continue it's gonna show up into a page where I have to select the plugins so based upon you need you can differ you can do the cherry-picking over here on the selected plugin but since it's a basic installation and eat everything and I will install my bitbucket plugin as per my need so I'm gonna say install suggested plug-in and it's gonna install a tons of stuff so it's gonna install the credential builder Gradle is also included as part of a plugin installed github SVN support if you wanna if you are in a big organization like enterprise you don't want to create new users for each and every each and every user again so you can integrate with LDAP it by default comes with the gate pipeline and if you get get support and then after that if you want to use the pipeline for the CDJ or staged view so this it will automatically install that thing as well and then after that it's gonna have her email extension and the SSL slaves an email for the notifications and SSL slaves for having more Jenkins slaves to scale out your Jenkins and the interesting part is it doesn't slack is being very popular and it doesn't just solve the slacks a la extension with that so what you but if you need the slack then you can of course go ahead and install a slack for game and do a simple google and oh you can install it and you can get multiple kind of notification so what slack like build it's very bleeding it's bad or like builds completed or build was bad and it recovered so those kind of interesting stuff you can do that so you can go to slack and create a profile create a web who can see create and add it here after installing the slack plugin in Jenkins so there are tons of stuff to do that but this tutorial is limited to the basic installation thank you for being here with me we are almost done so meanwhile of time I am expecting that you can skip this installation part if you want I have a bit bucket server running sorry bit bigger profile created so I'm going to go and create a repository and I'm gonna say that spring boot demo you if you don't need to read me you can skip this part I'm using dirt create repository so here you go spring boot demo then after that I went to the spring any slicers and since I'm using Gradle I will use the Gradle project you can have your group ID I just created Springwood demo hit enter it's going to generate a project for you so I already downloaded this project and I have imported into intelligence so you can feel free to use anything you want but I'm using a springboard for this demo purpose so I'm gonna go back again to the setup wizard so basically I can say add main admin admin admin and admin add company name.com so basically here you can put whatever you want I'm just using by default admin admin and everything it as a admin here you can put your DNS name and by after that you can if you want a plan have plan to install as research the SSL Certificates you can do that but it's the basic installation I'm gonna say like okay save and finish there you go so let's create a new job or a new item I'm gonna say fringo demo and also the Freestyle project I'm gonna say okay so our CI is basic template is created now you have to install the bitbucket plugin to support it so you're gonna go to the my home screen click on manage Jenkins go to the manage plugins click on available and type paired okay sorry you need integrate with bitbucket plugin so you can say installed with restart without restart or you can say download now and install after restart so I'll click here install restart later or something but in many of the scenario it works but many of the scenario it it doesn't work it needs a restart so if you are working in a enterprise organization probably when you're restarting your application it's hindering current cio 3d jobs or those kind of things so you have to take care of those things I'm gonna go ahead since it's a basic installation I'm running on my machine no one is using so I'm gonna go ahead and hit restart so it's gonna restart it a couple of time so meanwhile of time I will go to the bit bucket and push some code over here so it need not to be cold it could be a simple file or anything but I'm just using the spring boat so I'm gonna copy this and I have to configure this code to push on the repository so I'm I will go to the location where my project is spring boot and I'm gonna say git init so one more thing guys if you don't have a get installed get it installed whether it's Mac Windows or anything like Linux run the gate in it and then after that you have to say that get this code will point to this repository then after that you have to say get add all the files then you can say get commit - em message and I will say initial commit then you have to push the code to get push origin master if you are using any kind of tool you can use it I like command from battles so feel free to use IntelliJ or eclipse or NES vientre tides throw toys get it or something like that so the code is pushed and if I'm gonna go ahead and refresh this page I can see the code popped up so let's see that track let's track what we did so far so we installed the bathing installation install the bitbucket plugin we created a sample CI job which we need to work on and I think we missed the track and jumped here and created a code or a project into bitbucket and post the code so I think we are good here so let's jump back to the CI job harder so if you remember we install the bitbucket plug-in here and then after that we while installing we kept the password admin and whant username and password it will hit into and go inside let's go to our project and let's configure or you can start from scratch if you want so I mean I can let's do from scratch let's not have any confusion so let's click and create new jobs I'm gonna say a spring boot demo project freestyle okay then I'm go to the source code management I'm gonna say this is good project and I'm gonna copy the URL and I'm gonna put it here and it will remove the get flown part from this side and I'm gonna remove my user name I will hit the credential part they use the name of kid pocket and yeah my credential hit add so into the bill took apart I'm gonna say bill when changes push to be project and into the build part I'm gonna say for example I'm gonna run a shell script and I'm gonna run great dull w clean build apply safe so we have configured this CI job and we can click on build now and test that if it works awesome so it worked so let's go back to the project and see the track and see where we are so now the next step is to integrate the Jenkins with webhook so we have the Jenkins installed we have a CI job and we have code called project committed and ready now we have to tell Beth Jenkins that Haga hey invoke this webhook when anything is committed so it needs an IP and port so let's go back and see what is my IP so my current IP is this so we'll copy this guy so just just one clarification guys so since currently I'm on DHCP it's not a stack it static IP it is being generated by DHCP server which may change so this is just the demonstration purpose only if you don't want to have a static IP or you don't want to pay the static IP cost and want to learn those stuff so this is for this one only so I'm gonna put the IP over here and if you guys remember the default port which is running is this so I'm gonna copy this flag remove URL go back to the bitbucket go to the settings and here you can find the web hook and I'll say add vehicle and I'm gonna say Jenkins by book I would put this URL here and hit save so now my Jenkins is configured to go and hit this URL if any change is made and my CI job will get triggered based upon what we have configured so what we are we have configured for each and every code push but when Jenkins will try to hit this URL it will basically come to modem and we have to tell modem that if anything is coming to you means this with port 8080 then go to this machine which where the Jenkins is running so it's basically the local Hoth which is this machine current machine which you are looking at so I'm gonna say that if it is coming to you with port 8080 hey mo damn if anything with coming to port 8080 forward with this machine so I'm gonna see what is the IP of this machine so I'm using a Wi-Fi so this is the IP and then after that I will just paste it here you have to go to your modem so pretty much every modem is log in is 192 dot 168 of 0 to 1 so I will hit enter and I'm using essentially laying Internet connections this CenturyLink modems it for you it could be different and to locate the admin username password you can see on your modem it's usually there and if not then you would we have having some documentation of the username password of the modem so all you need to do is to do a port forwarding so whenever a request is coming with port 8080 over here like we discussed you need a port forwarding so what I'm gonna do here is gonna say I can remove it and show it back again so I'm gonna say here that if anything is coming to you modem which is this with port 8080 then transfer it to this IP so I'm gonna copy this IP paste it here and I'll say starting port is ID ID and then after that I'm gonna say protocol TCP IP all IP addresses and then I'm gonna say apply so once the mod I have configured that whatever any of the requests coming with ad ad will be forwarded to this IP then you are Kurt so let's go and make some changes and see if our web book works so currently we have only one build so what I'm gonna do here is I will add just line to make change and on to the command prompt let's go back here again I'm gonna say git add - a then I'm gonna say git commit build sugar test and then I'm gonna say git push origin master output password over here so now the bitbucket received a change it invoked the web hook and now you can see the CI job is running and just FYI guys let's see the results was awesome we did it so just FYI cus so your Jenkins which is running here on localhost is now exposed to the Internet what is IB so currently I'm running the Jenkins and the port forwarding on the same machine so if you are in the same environment of the broadband probably you will be not able to access it but if you'll go to some different network for example if you will just open your mobile and then after that hit this guy so pretty much cool you can do it from any other network from your mobile and you can show your friends the cool stuff you did so using this URL you can see the same Jenkins here thank you guys thank you for watching hopefully it will be helpful and I'm gonna change this IP and remove the port forwarding so just FYI if you wanna just try it's not gonna work have a good day
Info
Channel: Shah Alam
Views: 28,441
Rating: 4.6907215 out of 5
Keywords: Integrate Jenkins with Bitbucket, Integrate Jenkins with Bitbucket with home IP, Integrate Jenkins with Bitbucket with out static ip, Integrate Jenkins with Bitbucket GIT, Integrate Jenkins with Bitbucket with GIT, Integrate Jenkins with Bitbucket using GIT on each commit and push, jenkins, bitbucket, spring boot, java springboot Continuous Integration with jenkins and bitbucket at home, jenkins with webhook with bitbucket
Id: mTPsnR17MIM
Channel Id: undefined
Length: 20min 32sec (1232 seconds)
Published: Wed Nov 14 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.