Gitlab CI CD Tutorial For Beginners | Getting Started with Gitlab and CICD

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello friends welcome back to my channel and today we are back with another exciting series of tutorial so this uh going to be a continuation of my git tutorial but this would be a completely a different uh topic because we see about git in the previous tutorial but this will be a gitlab ci cd tutorial for beginners so you know like we have used jenkins for a lot of uh continuous integration and continuous deployment now we can also use gitlab for that so before i know let's starting on the gitlab part this will be a completely basics tutorial where we'll be talking about ci cd we also will see about git lab how to create project also how to make you know the basic preparation for the ci cd so we'll see some projects some configuration in that so to start with uh ci cd if you don't know ci stand for continuous integration whereas cd stands for continuous delivery and also there is one more cd which is called continuous deployment so we have to understand these all these terminologies to under you know to know more about uh the ci cd process what we will do in gitlab okay so when see i say it's continuous integration then we have continuous delivery and continuous deployment now let's see about all these uh differences between ci cd you know and other cds so what is what this all about so in order to start let's start with continuous integration so as you know like you know why we do all this thing is because we have a lot of developers now in the recent you know environments what we will do is we have developers working on a code right and we'll have the source code in our git repository and we will allow you know developers working on their own local repository right and you know so they every developer will have a small part developed and once they put into the main branch it should not have issues right so that is where this continuous integrations come into the part so in continuous integration these developers merge their changes back to the main branch as often as possible so what uh it does it means like you know uh there are developer a b c d so everybody have their own you know future branches which they are working and what they will do is they will merge back to you know the branch which is you know available for them and then from there it will be bran merged to the main branch but there will be a different upload process in that but uh continuous integration what will happen is these changes are validated by creating a build and running automated unit test so when these developers want to make this you know mergers to the their branch what uh automatically what happen is it will start a build of that application and it will do some unit test to make sure that it does not break the actual application so the benefit of this is like you know this continuous integration is all these are automated process so this helps to avoid the integration challenges and check the application is not broken whenever a new commits are done so you know as you the statement says right so this automated uh continuous integration helps in the integration challenges because multiple versions of code comes up it will create a lot of integration issues at the end right so if you do these automated checks and the application is got not getting broken this will uh you know help them to have a proper process okay so how it will happen in a pictorial better represent like you have a build right uh which and from the bill you have an automated unit test or integration testing which they will do it and they know based on that it will do a merge right so that's how it happens in the continuous integration uh process now let's see about the continuous uh delivery okay so when we talk about continual delivery it's an extension of continuous integration okay and by which it automatically deploys all the code changes to a testing or staging environment so in the continuous integration we do all the you know integration parts to make sure that the application is not broken but we are not deploying that code into any testing or staging or production environment right it is still uh kept aside so what in continuous delivery what we do is we will automatically deploy all those changes into a testing or staging environment we don't do it to a production automatically okay but there are a possibility like you know you can stop in the automatic process at the staging environment then the final product production you know will be with a manual intervention okay so that's a continuous delivery now the goal of continuous delivery is to have a code base that is always ready for deployment for a production amendment what this means like once you have a continuous delivery process in place means you always you know whenever there is a change or some developer makes a code not a merge or checking what do you know happens is like it will do all these tests automatic process test bill all these things and then at the end you will have you know a code uh completely ready to be deployed in production if you want you can just click a button and or just say yes then it will get deployed to the production so to just give it pictorial person as we did for continuous integration so you have built unit tests and then merge this would be the continuous integration part right then if you after that you can do an automatic acceptance test and also you have a deployment to staging area and but after that should be a manual process the deployment to production should be a manual process so that is the difference between continuous integration and continuous delivery now if you moving on to continuous deployment so this is also you know it's a continuation of that so what the difference is every change that passes all stages of production pipeline will be released to the customer or production environment itself so what is it happens like when we is shown about the pipeline where build testing uh you know staging all those things are passed what will do do is like it will also deploy to the production or customer environment automatic so this is a completely you know automated process there is no humor in human intervention at all in this uh continuous deployment so the whole process is automated so there is no uh human intervention this so if it's a build stage or if it's an uh unit test or it's emerging or as we said that's the continuous integration part or it can be you know acceptant test or deploying to uh you know staging area and even to deploy to production all are you know in automated stage so that is the continuous deployment so the difference as you see there you know between continuous integration uh delivery and deployment so this is how it will look like so like the pictorial representation we uh show you this will be for continuous integration and if it's for a continuous uh delivery it will be you know like this where you have the production uh activity alone in the manual phase but if you go for a continuous deployment it should be like completely automated so there is no human interventions completely all the stages are into the automated phase so before i get into the real process with the gitlab and the cacd i would request like if you are new to my channel or if you have not subscribed to my channel click on the subscribe button and also like my video share and comment okay let's uh now talk about the gitlab uh tutorial so what we will do in this tutorial would be like new you understood now what is a ci cd process so what we will do is we'll be creating a gitlab project and we'll upload some sample code there and we will also see what are the some of the settings and also the requirement for a gitlab ci cd pipeline configuration so we will be this will be a preparation phase so you know it will be a step-by-step tutorial so in this phase you will be unable to understand what is a gitlab project and also what are the settings uh what is the gitlab runner you know you also need to know what is the file which we have to create in a you know gitlab for ci cd to be configured all those things we will see in this tutorial so let's get started so i have my gitlab uh you know it can be your own instance which you can run it on some of your server or it can be you know the sas instance from gitlab okay so i have shown also one of my tutorial to how to set up gitlab on centos you can follow that and you can set up your own gitlab as well so now if you see you know you can see the projects here so if i go to my projects you can see these other projects right and if you want to create a project click on new project okay and i'm going to use a blank project and i'm going to give it name so i'm going to give a name as test maven project and you can give a description as well so i will type this is a test maven java project okay and i'm going to keep this as private if you want to keep it public you can keep that as well but since this is a testing project i want to keep it as private then i'll click on create so now once you create the project is created but we don't have any data added right so now you can see these instructions these all instructions we already seen in our tutorial for git so you know already like how to clone a project how to do a commit how to add you know the contents into the staging area how to move that into the local repository right how to push that into the git repository all those things you should be knowing it right so what i'm going to do is i'm going to just clone this project first okay so i'll just use this so i have the git bash open so you can see you know i don't have anything inside this folder so i'm going to use uh the command which we use git clone okay so i'm just going to run that so you can see we should have that project here so i'm going to use test maven project okay and uh now you can see this name has we have a master or the rights what does means like we are inside the git project so if i go to my git project you should have another project here okay but it's a blank project and what i want to do is i want to add some content so i'm just going to paste some content here okay this is a sample uh java project okay and if i go to the git bash and get status you should be able to see like there are some untracked file right so you have to add git add and then if i see git status it should show like there are something which you need to be commit right then i will do a git commit and the message initial commit it can be any comment okay so now you have the files added so now what you need to do is you need to push that into the repository right so in order to push the repository you have to use git push and hyphen you origin master okay so let's see what it does so you can see it's uh done the push as well so let me come back here let me refresh this page so now you can see all the contents are pushed here right so now our git repository is updated so you have all uh you know the files over here now if you see okay you have different options like you know set up a ci cd add kubernetes cluster so and on the left side you have the project information repositories right issues merge request ci cd security deployment so the benefit of git lab is you know it's a complete package it's not like jenkins you know where you need to have a lot of plugins to be installed but you already have most of the features here itself but in order to do this uh gitlab ci cd one thing you should have is like you should have a file called uh gitlab hyphen ci dot yaml okay that's the file like similar to jenkins file you need to create a file inside this uh root location so that it will take you know that so if you go to ci cd you will have you know options like you know how to use the sample if you want to use these templates you can you have to create this file in order to start the pipeline otherwise you will not be able to do it because all the whole definitions of our stages about the you know jobs and everything should be defined here okay so that i will show you in the next tutorial how to write this one how to start some jenkins pipe sorry the gitlab pipeline uh using this gitlab ci dot yaml file we'll start with small uh pipeline then we will go with the even maven projects so we'll do step by step so but a few things which you need to do is like you know we need to also have some uh settings to be done so in ci cd you know if you go to the settings you have something uh these settings like general pipeline auto devops runners so this runner is something which uh we need to set up so this would be a separate tutorial where i'll be also showing how to set up runner but you know there are there are also calls uh shared runners okay so but if you see these runners are shared across gitlab instance and they are free to use for public open source projects and but limited to 400 cm minutes per private project okay so if it's a private project you can only use it for 400 cm minutes but you can also set up uh you know gitlab runner using some instructions so i will show you that as well so i would say like you know we will do that in the upcoming tutorial how to set up runner so runner basically you means like you know that you should have some place to run the pipeline right so if you're running a maven job you need to have a you know setup where you have you know a system where you have maven available and we can you have to run those build commander right so that's the runner so we'll also see in the upcoming tutorial how to set up runners uh for different scenarios whether it's a windows runner then we'll be how to use powershell kind of commands if it's a linux we can use shell or you know if you can also use docker so that you know we can create the docker containers and then some of the things like maven and everything can run on the docker container itself and also something we you need to do is you know we you also need to set up an ssh for git lab for uh you know connecting or pushing pulling you know all those things so you need to have an authentication between your system and you know for your gitlab instance that also we will see in the upcoming tutorial as a separate one how to create ssh between your gitlab and your host machine so you should not have any issues when pushing or pulling the content okay otherwise you may get into issues like permission denied issues so that also we will see it in the upcoming tutorial okay so in the ci cd section you can see like there are four sections like pipeline editor job schedules right so basically pipeline is the word we'll be you know having uh all the job information let me show you a sample okay i will go to one of my project a project okay if i go to my game of life project and if i go to my pipeline you can see you know i have a few pipeline here right some of most of them has failed some of them i have cancelled right and the similar way you know if i go to my other project which is for first project right if i go to the pipeline you can see you know i have a few projects passed right and you know some of them has failed and you know you should be able to see the jobs here so if i go to the job you should be able to see the whole thing okay and you can also see you know how the jobs works and all those features you should be able to see like finished right and all tags okay so all those things you should be able to see it uh in this cicd section if i go to one of this past you know uh pipeline you can see i have a different stages like build test deploy right and there are different jobs so all those things we will see how to create in the upcoming tutorial but i just wanted to show you like these are some pre-requests which you should know uh for uh you know creating this pipeline okay so you can see i have one gitlab dot ci dot yaml file right which i'm using it so similar way you know we will create the gitlab hyphen ci dot yaml file and also we'll uh write down the content of the file to create this build jobs so as i discussed uh previously like what we will do in the next tutorials of this ci cd tutorial will be will how to set up ssh in gitlab for uh authentication between your system and gitlab so we will see that how to do that we will also see how to do an installation and configuration of gitlab runner so we can do it on windows git lab windows runner as well also as on linux site so we'll see both scenarios okay because in windows we we probably mostly use the powershell commands whereas in the linux we can use other kind of shell and docker those kind of commands okay and we'll also see how to create gitlab pipeline and run the pipeline which i showed you some samples in the upcoming tutorial so please know keep watching for more videos on gitlab so this would be really interesting tutorial and you know like what we use for jenkins and all those can be all we'll do all those kind of integration with gitlab as well so i hope this tutorial is informative for you so keep watching for more videos so click on the subscribe button and like this video share and comment
Info
Channel: Thetips4you
Views: 33,770
Rating: undefined out of 5
Keywords: gitlab ci cd tutorial for beginners, gitlab ci cd tutorial, gitlab ci cd, gitlab ci cd runner, gitlab ci cd pipelines, gitlab ci cd docker, gitlab ci cd pipeline tutorial, gitlab ci cd example, gitlab ci/cd español, gitlab cicd getting started, gitlab ci cd tutorial in hindi, jenkins vs gitlab ci/cd, gitlab ci cd pipeline docker, gitlab ci cd setup, gitlab ci cd ssh, gitlab ci cd stages, gitlab ci cd windows, gitlab ci cd yaml tutorial, gitlab ci tutorial, thetips4you, git
Id: DWb1HNmbmeM
Channel Id: undefined
Length: 19min 33sec (1173 seconds)
Published: Mon Jul 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.