GitLab CI – Configuring Gitlab Runners ”; Previous Next Description GitLab runner is a build instance which is used to run the jobs over multiple machines and send the results to GitLab and which can be placed on separate users, servers, and local machine. You can register the runner as shared or specific after installing it. The installation of runner is explained in the GitLab Installation chapter. You can serve your jobs by using either specific or shared runners. Shared Runners These runners are useful for jobs multiple projects which have similar requirements. Instead of using multiple runners for many projects, you can use a single or a small number of Runners to handle multiple projects which will be easy to maintain and update. Specific Runners These runners are useful to deploy a certain project, if jobs have certain requirements or specific demand for the projects. Specific runners use FIFO (First In First Out) process for organizing the data with first-come first-served basis. You can register a specific runner by using project registration token. The registering a specific runner is explained in the GitLab Installation chapter from step 1 to 12 under the Installation of GitLab on Windows section. Locking a specific Runner You can lock a specific runner from being enabled for other projects. To do this, you need to register a runner which is explained in the GitLab Installation chapter from step 1 to 12 under the Installation of GitLab on Windows section. To lock runner, execute the below steps − Step 1 − Login to your GitLab account and go to your project − Step 2 − Click on the CI/CD option under Settings tab and expand the Runners Settings option. − Step 3 − Under Runners Settings section, you will see the activated Runners for the project − Step 4 − Now click on the pencil button − Step 5 − Next it will open the Runner screen and check the Lock to current projects option − Click on the Save changes button to take the changes effect. Step 6 − After saving the changes, it will update the Runner successfully. Protected Runners The runners can be protected to save the important information. You can protect the runner by using below steps − Step 1 − Follow the same steps (from step 1 to 4) which are explained in the previous section (Locking a specific Runner). Step 2 − After clicking on the pencil button, it will open the Runner screen and then check the Protected option − Click on the Save changes button to take the changes effect. Run untagged Jobs You can prevent runners from picking jobs with tags when there are no tags assigned to runners. Runner can pick tagged/untagged jobs by using below steps − Step 1 − Follow the same steps (from step 1 to 4) which are explained in the Locking a specific Runner section. Step 2 − After clicking on the pencil button, it will open the Runner screen and then check the Run untagged jobs option − Click on the Save changes button to take the changes effect. Print Page Previous Next Advertisements ”;
Category: gitlab
GitLab – Adding Users
GitLab – Adding Users ”; Previous Next In this chapter, we will discuss about how to add users to your project in the GitLab. Steps for Adding User Step 1 − Login to your GitLab account and go to your project under Projects section. Step 2 − Next, click on the Members option under Settings tab − Step 3 − It will open the below screen to add the member to your project − Step 4 − Now enter the user name, role permission, expiration date(optional) and click on Add to project button to add the user to project − Step 5 − Next, you will get a successful message after adding user to the project. The highlighted box in the above image indicates, a new user has been added to the project − Step 6 − You can also add user to the project by clicking on the Import button − Step 7 − Now select the project from which you want to add the user to your project and click on the Import project members button − Step 8 − You will get a success message after importing user to the project − Print Page Previous Next Advertisements ”;
GitLab – Fork a Project
GitLab – Fork a Project ”; Previous Next Description Fork is a duplicate of your original repository in which you can make the changes without affecting the original project. Forking a Project Step 1 − To fork a project, click on the Fork button as shown below − Step 2 − After forking the project, you need to add the forked project to a fork group by clicking on it − Step 3 − Next it will start processing of forking a project for sometime as shown below − Step 4 − It will display the success message after completion of forking the project process − Print Page Previous Next Advertisements ”;
GitLab – Create Issue
GitLab – Create Issue ”; Previous Next In this chapter, we will discuss about how to create an issue in a project − Step 1 − Login to your GitLab account and go to your project under Projects section − Step 2 − Go to Issues tab and click on the New issue button to create a new issue as shown below − Step 3 − Now, fill the information such as title, description and if you want, you can select a user to assign an issue, milestone(refer this chapter for more information), labels upon operation or could be choose by developers themselves later. Step 4 − Click on the Submit issue button and you will get an overview of an issue along with title and description as shown below − Print Page Previous Next Advertisements ”;
GitLab CI – Container Registry ”; Previous Next Description Container registry is a storage and content delivery system, which stores their Docker (it is database of predefined images used to run applications.) images. Deploying the Registry You can deploy the registry by using the below commands − Step 1 − First, login to your GitLab server using SSH (Secure Shell). Step 2 − Now start the registry container by using below command − $ docker run -d -p 5000:5000 –restart = always –name registry registry:2 The -p 5000:5000 specifies first part as host port and second part as port within the container. The –restart = always flag restarts the registry automatically when Docker restarts. The registry:2 is defined as an image. Step 3 − Now, pull the image from Docker hub to your registry − $ docker pull ubuntu:16.04 The above command pulls the ubuntu:16.04 image from Docker Hub. Step 4 − Next, tag the image to point your registry − $ docker tag ubuntu:16.04 localhost:5000/my-ubuntu Here, we are tagging the localhost:5000/my-ubuntu image for an existing ubuntu:16.04 image. Step 5 − Push the image to local registry which is executing at localhost:5000. $ docker push localhost:5000/my-ubuntu Step 6 − Now remove the cached (ubuntu:16.04 and localhost:5000/my-ubuntu) images from the registry − $ docker image remove ubuntu:16.04 $ docker image remove localhost:5000/my-ubuntu Step 7 − Pull back the localhost:5000/my-ubuntu image from local registry − $ docker pull localhost:5000/my-ubuntu Step 8 − Now stop the registry and remove the data − $ docker container stop registry && docker container rm -v registry Print Page Previous Next Advertisements ”;
GitLab CI – Permissions
GitLab CI – Permissions ”; Previous Next User Permissions The following table shows available user permissions levels for different types of users in a project − S.N. Guest Reporter Developer Master Owner 1 Creates a new issue Creates a new issue Creates a new issue Creates a new issue Creates a new issue 2 Can leave comments Can leave comments Can leave comments Can leave comments Can leave comments 3 Able to write on project wall Able to write on project wall Able to write on project wall Able to write on project wall Able to write on project wall 4 – Able to pull project code Able to pull project code Able to pull project code Able to pull project code 5 – Can download project Can download project Can download project Can download project 6 – Able to write code snippets Able to write code snippets Able to write code snippets Able to write code snippets 7 – – Create new merge request Create new merge request Create new merge request 8 – – Create new branch Create new branch Create new branch 9 – – Push and remove non protected branches Push and remove non protected branches Push and remove non protected branches 10 – – Includes tags Includes tags Includes tags 11 – – Can create, edit, delete project milestones Can create, edit, delete project milestones Can create, edit, delete project milestones 12 – – Can create or update commit status Can create or update commit status Can create or update commit status 13 – – Write a wiki Write a wiki Write a wiki 14 – – Create new environments Create new environments Create new environments 15 – – Cancel and retry the jobs Cancel and retry the jobs Cancel and retry the jobs 16 – – Updates and removes the registry image Updates and removes the registry image Updates and removes the registry image 17 – – – Can add new team members Can add new team members 18 – – – Push and remove protected branches – 19 – – – Can edit the project Can edit the project 20 – – – Can manage runners, job triggers and variables Can manage runners, job triggers and variables 21 – – – Add deploy keys to project Add deploy keys to project 22 – – – Able to manage clusters Able to manage clusters 23 – – – Configure project hooks Configure project hooks 24 – – – Can enable/disable the branch protection Can enable/disable the branch protection 25 – – – Able to rewrite or remove Git tags Able to rewrite or remove Git tags The following table shows available group members permissions levels in a group − S.N. Guest Reporter Developer Master Owner 1 Browse group Browse group Browse group Browse group Browse group 2 – – – – Edit group 3 – – – – Create subgroup 4 – – – Create project in group Create project in group 5 – – – – Manage group members 6 – – – – Remove group 7 – Manage group labels Manage group labels Manage group labels Manage group labels 8 – – Create/edit/delete group milestones Create/edit/delete group milestones Create/edit/delete group milestones 9 – View private group epic View private group epic View private group epic View private group epic 10 – – – – – 11 View internal group epic View internal group epic View internal group epic View internal group epic View internal group epic 12 View public group epic View public group epic View public group epic View public group epic View public group epic 13 – Create/edit group epic Create/edit group epic Create/edit group epic Create/edit group epic 14 – – – – Delete group epic 15 – – – – View group Audit Events The following table shows available GitLab CI/CD permissions in the GitLab − S.N. Guest/Reporter Developer Master Admin 1 Can see commits and jobs Can see commits and jobs Can see commits and jobs Can see commits and jobs 2 Retry or cancel job Retry or cancel job Retry or cancel job 3 – Deletes job artifacts and trace Deletes job artifacts and trace Deletes job artifacts and trace 4 – – Remove project Remove project 5 – – Create project Create project 6 – – Change project configuration Change project configuration 7 – – Add specific runners Add specific runners 8 – – – Add shared runners 9 – – – Can able to see events in the system 10 – – – Admin interface Job Permissions The following table shows job permissions in the GitLab − S.N. Guest/Reporter Developer Master Admin 1 – Run CI job Run CI job Run CI job 2 – Clone source and LFS from current project Clone source and LFS from current project Clone source and LFS from current project 3 – Clone source and LFS from public projects Clone source and LFS from public projects Clone source and LFS from public projects 4 – Clone source and LFS from internal projects Clone source and LFS from internal projects Clone source and LFS from internal projects 5 – Clone source and LFS from private projects Clone source and LFS from private projects Clone source and LFS from private projects 6 – Push source and LFS Push source and LFS Push source and LFS 7 – Pull container images from current project Pull container images from current project Pull container images from current project 8 – Pull container images from public projects Pull container images from public projects Pull container images from public projects 9 – Pull container images from internal projects Pull container images from internal projects Pull container images from internal projects 10 – Pull container images from private projects Pull container images from private projects Pull container images from private projects 11 – Push container images to current project Push container images to current project Push container images to current project 12
GitLab – Introduction
GitLab – Introduction ”; Previous Next What is Gitlab? Before we dive into definition for Gitlab, first we need to understand few terminologies. We often come across these terms like Git, Gitlab, GitHub, and Bitbucket. Let”s see definiton of all these as below − Git – It is a source code versioning system that lets you locally track changes and push or pull changes from remote resources. GitLab, GitHub, and Bitbucket – Are services that provides remote access to Git repositories. In addition to hosting your code, the services provide additional features designed to help manage the software development lifecycle. These additional features include managing the sharing of code between different people, bug tracking, wiki space and other tools for ”social coding”. GitHub is a publicly available, free service which requires all code (unless you have a paid account) be made open. Anyone can see code you push to GitHub and offer suggestions for improvement. GitHub currently hosts the source code for tens of thousands of open source projects. GitLab is a github like service that organizations can use to provide internal management of git repositories. It is a self hosted Git-repository management system that keeps the user code private and can easily deploy the changes of the code. History GitLab was found by Dmitriy Zaporozhets and Valery Sizov in October 2011. It was distributed under MIT license and the stable version of GitLab is 10.4 released in January 22, 2018. Why to use GitLab? GitLab is great way to manage git repositories on centralized server. GitLab gives you complete control over your repositories or projects and allows you to decide whether they are public or private for free. Features GitLab hosts your (private) software projects for free. GitLab is a platform for managing Git repositories. GitLab offers free public and private repositories, issue-tracking and wikis. GitLab is a user friendly web interface layer on top of Git, which increases the speed of working with Git. GitLab provides its own Continuous Integration (CI) system for managing the projects and provides user interface along with other features of GitLab. Advantages GitLab provides GitLab Community Edition version for users to locate, on which servers their code is present. GitLab provides unlimited number of private and public repositories for free. The Snippet section can share small amount of code from a project, instead of sharing whole project. Disadvantages While pushing and pulling repositories, it is not as fast as GitHub. GitLab interface will take time while switching from one to another page. Print Page Previous Next Advertisements ”;
GitLab – Create a Branch
GitLab – Create a Branch ”; Previous Next Description Branch is independent line and part of the development process. The creation of branch involves following steps. Creating a Branch Step 1 − Login to your GitLab account and go to your project under Projects section. Step 2 − To create a branch, click on the Branches option under the Repository section and click on the New branch button. Step 3 − In the New branch screen, enter the name for branch and click on the Create branch button. Step 4 − After creating branch, you will get a below screen along with the created branch. Print Page Previous Next Advertisements ”;
GitLab – Import Repository
GitLab – Import Repository ”; Previous Next In this chapter, we will discuss about how to import a repository from Bitbucket to GitLab − Step 1 − Login to your GitLab account and click on the New project button in the dashboard − Step 2 − Click on the Bitbucket button under Import project tab − Step 3 − Next, you need to login to your Bitbucket account. If you don”t have an account, then create a new account by clicking on Sign up link and then login to Bitbucket account. Step 4 − When you click on the Bitbucket button (shown in step 2), it will display the below screen and click on the Grant access button − You need to grant the access to read the account information, repository issues, project settings, and modify the repositories. Step 5 − Click on the Import button to import the project from Bitbucket − Step 6 − After importing the project successfully, it will display the status as Done − Print Page Previous Next Advertisements ”;
GitLab – CI/CD
GitLab – CI/CD ”; Previous Next Description GitLab CI (Continuous Integration) service is a part of GitLab that build and test the software whenever developer pushes code to application. GitLab CD (Continuous Deployment) is a software service that places the changes of every code in the production which results in every day deployment of production. The following points describe usage of GitLab CI/CD − It is easy to learn, use and scalable. It is faster system which can be used for code deployment and development. You can execute the jobs faster by setting up your own runner (it is an application that processes the builds) with all dependencies which are pre-installed. GitLab CI solutions are economical and secure which are very flexible in costs as much as machine used to run it. It allows the project team members to integrate their work daily, so that the integration errors can be identified easily by an automated build. Print Page Previous Next Advertisements ”;