Gitlab CI pipeline tutorial for beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi there this is Valentine and welcome to another tutorial this time I wanted to introduce you to get lab CI soget lab continuous integration tool this is built in the get lab tool you do not need to download any software or anything like that all you need is a browser and get lab account it's totally free so if you haven't created an account do that now and once you are logged into your account you should see something like new project here on the right so we're gonna create a very simple project and we are gonna create a continuous integration pipeline it will be very very simple but just to demonstrate the basic functionality of get lab so go ahead click new project and this will be something like my simple pipeline and right here below you have the possibility of selecting the visibility you can make it public if you want but I will leave it private because I'm just playing around so right here below I'm gonna create the project now once that is ready you will have normal repository so there's nothing inside it so the first thing that we'll do is create a new file and this file will be called that it lab - see I got mo so this is how the file should be named and this is a convention it will automatically recognize it so what we're trying to do here is to create two basic stages there will be a build stage and there will be a test stage now in the build stage I will do something very simple I create a file and then in the head stage I will test that that file was actually created in the previous lab so pretty pretty basic now in order to get something to run you need to define some build steps so we are going to define the stages how they are called in gate level so I'm gonna say something like stages column and then with the tap I'm gonna say there's a build stage and there is a test age so these are the stages the two stages that we'll have and now we have to define the jobs themselves so well can I have a build and you can define it as you want so you can name it as you want but it's important now to say that to the stage it's built and the next thing we can really get into coding so we can really define what this stage to do so this will be something like script and now we can just type in something like a hole and I say this is building and the second step will be let's create a new directory called build and let's create a file inside this directory we'll be a simple empty file nothing special and now let's create test job and this will be part of the stage test this is the second taste this is a second stage that we're running and again we'll have a script and in this case we're gonna say something like testing this is just demonstrate that you can enter multiple commands one after the other and we're gonna use the test command and I'm gonna test that this is a file I'm gonna say build in four dot txt okay so now we have this let's commit and see if the syntax that we have here is valid and we're getting this message here that this kid lab configuration is valid and that is actually great news now if we go to the project overview you will see here that something has started to build so this is the icon that it's showing you that the pipeline has started and I didn't need to configure anything in particular just by having this file here and no other files gitlab started building this pipeline as instructed and if I click this icon you will be actually able to see the pipeline how it looks I will see they are two stages and there's the build stage and there's the test stage this is the job name so now right now we're building and this will take a minute to start a docker image and to actually execute us the first stage succeeded and this goes down to the second stage and you will see now the second stage is running as well so let's see if this is successful and I will see that this job actually failed and this is because in the previous job we created some files and after the job completed everything was sort of a thrown away so we need to find a way to make these two separate jobs communicate with one another and the magic word in this case is artifacts we need to define some artifacts so that the first job can create those artifacts and inform the next job or any other job in between to access that those artifacts so we'll have to change a bit our configuration in order to do that and at the build step you will see that after the script we need to add something like artifacts and we're gonna say here that we define some paths where these artifacts should be located and only artifact that we are interested in are inside a build folder so this should probably be enough to publish those artifacts so let's commit those changes again and see now if the pipeline is successful you can also easily see the pipeline's that are currently running if you go on its left panel on click on see ICD pipelines you will see now that this current pipeline is running it's on the first stage and still needs a bit to complete but soon it will get to the second stage and then it should probably be successful and now I just refresh the page and so that both stages are successful and let's go into the test one to see exactly what happened there and you'll see that this command has been displayed here testing and then the test itself that this file exists has worked as well and you'll see here the effect that these artifacts are being downloaded and this makes this entire pipeline work now this is a very very simple pipeline but as you can see you can build upon it and you can really get into more complicated things if you need to thank you for watching this tutorial give it a thumbs up if you think you have learned something new and if you're interested in more detail tutorials make sure you hit the subscribe button because I'll be posting in the next period more tutorials see you next time bye bye you
Info
Channel: Valentin Despa
Views: 467,609
Rating: undefined out of 5
Keywords: gitlab-ci, gitlabci, gitlab-ci-tutorial, gitlabci-tutorial, gitlab-pipeline, continuous-integration
Id: Jav4vbUrqII
Channel Id: undefined
Length: 7min 40sec (460 seconds)
Published: Thu Sep 27 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.