23:Sonarqube Integration for Python Project using GitLab CI/CD | GitLab CI/CD Tutorial for Beginners

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends welcome back to devops seed in this video we are going to learn sonar cube integration for python project using gitlab ci and in this you can see here i am using droplet of digital ocean so you can see this is ubuntu droplet and you know droplet we are going to install gitlab runner and python then here here you can see this is my uh sonarqube dashboard in my sonar cube i have three projects node.js project my app and then java gradle then here you can see this is my repository with the name python in my repository i have few files and now the first step is we are going to install gitlab runner on our digital ocean droplet that means this ubuntu droplet here and so you can go to the official page of gitlab runner so you can see here this is the official page of gitlab runner and now we are going to install gitlab runner so the first step is at the official gitlab repository so for ubuntu you can see the command and here you can see here i'm using mobx stream to connect my ubuntu terminal now we are going to install digital ocean r3 uh gitlab runner so now it's done now clear the screen and the next step is to install latest version of git lab runners so now copy the command for ubuntu so here i have already installed gitlab runner so you can see now clear the screen and now we are going to register runner so before register runner you need a repository so you can say this is my repository and now if you scroll down you can see the fourth step register runner now if you scroll down you can see the command for linux now we are going to register runner now it will ask and enter the gitlab installs url for example like this so firstly go to your repository then settings then ci cd then here click on runners and then here you can see the url then registration token so here the registration token now enter a description for the runner so my runner then tags so devops then enter an executor's shell so runner registered successfully so let's check so refresh the page now here you can see our runner so sometimes they give us errors so the solution is click on edit and then check indicates whether this runner can pick job without tags and then save changes now you can see our runner is running now it's done now let's take the next step now the next step is install python so firstly we need to update our system package so now it's done now we are going to install python now it's done also so now clear the screen and now if you want to check the version of your python then you can run the command python iphone iphone version so you can see the version now clear the screen then the next step is install python pip and it's also done now the next step is download the sonar cube scanner package so firstly we need to make a directory so let's create a directory then we need to inside this particular directory that we have just created then we are going to download sonar scanner using duplicate command so now it's done and now the next step is install and unzip unzip if you don't have unzip package so now we are going to install unzip package so it's done now clear the screen then now we are going to unzip this our sonar scanner zip file now it's done then the next step is move to this particular directory okay then now edit the sonar scanner.properties using this command and in this file we need to uncomment these two lines now save the file and exit then now we are going to create a new file to automate the required environment variable configuration and in this file we need to add these lines then use this source command to add the sonar scanner command now it's done now if you want to check the version of your sonar scanner then you can run the command sonar scanner hyphen v then the next step is create a file in your repository with the name sonar scanner properties and add this line so now firstly go to repository here then click on repository then files and here now we are going to create new file so click on this plus icon then new file sonar proper project properties and here you need to add these lines and you can say this is our project key devops in python project then commit changes now it's done now the next step is add variables in your gitlab repository so for that firstly go to your repository then settings then ci cd and here we are going to add three variables here so click on expand and add variable so first variable is sonar scan sonar host url so now paste here your sonar url then remove this protect variable flag then add variable then the second variable is sonar login that means your username remove this protect variable flag then the third variable is sonar password then remove this protect variable flag and then add variable now it's done now let's check the next step now the next step is create a dot gitlab iphone ci dot yml file that means our pipeline using below cover code now let's create pipeline so click on repository then files then here click on this plus icon then new file now here [Music] okay now here you can see in variables then image python 3.7 and in before script you can see a python version then pip install and all then here there are two stages first static analysis then state and in static analysis there are three steps and then test now commit changes and now let's check our pipeline so you can see our first job is running wait for few seconds so you can see it's passed it's also passed now it's running first now our test job is running so let's check so you can see the message job succeed so let's check in our sonar scan uh so sorry sonar the sonar cube so refresh the page here and now here you can see our project devops in python project and passed you can see a quality gate status passed so that means is done so in this video we have learned sonarcube integration for python project using gitlab ci so thank you for watching our video video i hope you liked the video and it's helpful to you so please like share and subscribe our devops channel
Info
Channel: DevOps Hint
Views: 6,806
Rating: undefined out of 5
Keywords: Sonarqube Integration for Python Project using GitLab CI/CD, GitLab CI/CD Tutorial for Beginners, gitlab ci cd pipeline tutorial, gitlab ci cd pipeline example, gitlab ci cd, gitlab ci cd tutorial, gitlab ci, gitlab ci cd pipeline, gitlab pipeline, gitlab tutorial for beginners, gitlab ci cd docker, sonarqube tutorial
Id: iGW8wAj76jQ
Channel Id: undefined
Length: 14min 5sec (845 seconds)
Published: Mon Feb 14 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.