Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Gitlab Cookbook
Gitlab Cookbook

Gitlab Cookbook: Over 60 hands-on recipes to efficiently self-host your own Git repository using GitLab

By Jeroen van Baarsen
€19.99 €13.98
Book Dec 2014 172 pages 1st Edition
eBook
€19.99 €13.98
Print
€24.99
Subscription
€14.99 Monthly
eBook
€19.99 €13.98
Print
€24.99
Subscription
€14.99 Monthly

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Dec 24, 2014
Length 172 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783986842
Table of content icon View table of contents Preview book icon Preview Book

Gitlab Cookbook

Chapter 1. Introduction and Installation

In this chapter, we will cover the following recipes:

  • Using the Omnibus package

  • Setting up the server dependencies for source installation

  • Setting up the database for source installation

  • Installing GitLab from source

  • Using Chef and GitLab Cookbook

  • Logging in for the first time

  • Creating your first project

Introduction


GitLab is a self-hosted system for managing your code. It was first released in October 2011, and is updated every twenty-second day of the month since then. It was released under the MIT license.

It used to be hosted on GitHub, but since January 2014, its main source of hosting is gitlab.com. The fork of GitLab, which is hosted on GitHub, will remain active as a source where you can file issues and merge requests.

GitLab was founded by Dmitriy Zaporozhets in 2013. He has worked on GitLab full-time since 2013. The project consists of two main groups: on one side, the open source core team, and on the other side, the GitLab B.V. team (the second one is the company side of GitLab).

Besides the amazing project management tool for Git projects, the GitLab Continuous Integration (CI) system also exists; this is a CI system that highly integrates with GitLab.

In this book, we will be using the Community Edition (CE) of GitLab. The CE version is the free open source version that you can download. There is also an enterprise version. The enterprise version includes a support subscription where the GitLab B.V. team helps you with problems with the installation of it.

If you want to give GitLab a try, or just don't want to host it yourself, take a look at gitlab.com. You can find the hosted version of GitLab there. It's run by the team behind GitLab B.V., so you know you're in good hands!

Using the Omnibus package


The people from GitLab have created an Omnibus package for the major Linux distributions (Ubuntu, Debian, and CentOS). These packages are an easy way of installing your GitLab installation, as they have all the dependencies packaged with them.

For this recipe, we are going to use the Ubuntu version of the Omnibus package.

Getting ready

Before we start installing, you need to have a server installed with a Ubuntu 12.04 64-bit system, and have SSH access to the server.

How to do it…

Here is how you can install GitLab using Omnibus:

  1. Download the package, change the X.Y.Z portion to the version you want to download. At the time of writing, 7.3.2 is the latest version:

    wget https://downloads-packages.s3.amazonaws.com/ubuntu-12.04/gitlab_X.Y.Z-omnibus.5.1.0.ci-1_amd64.deb
    
  2. Install the OpenSSH server:

    sudo apt-get install openssh-server
    
  3. Install Postfix:

    sudo apt-get install postfix
    
  4. Postfix will ask you what kind of installation you want; choose the Internet Site option.

  5. Enter the fully qualified domain name for the domain you want GitLab to send e-mails from (that is, gitlab.example.com).

  6. Install the Omnibus package, and replace the X.Y.Z part with your version:

    sudo dpkg -i gitlab_7.3.2-omnibus.5.1.0.ci-1_amd64.deb
    
  7. Now, we will configure your GitLab instance by running the following command:

    sudo gitlab-ctl reconfigure
    
  8. Check to see whether all the services are running using the following command:

    sudo gitlab-ctl status
    

    The output should look like the following screenshot:

You can now log in with the username root and password 5iveL!fe.

How it works…

We have just installed GitLab via the Omnibus installer. Omnibus is a way to package your application and install all the dependencies that are required to run it.

GitLab makes good use of this capability. As you only have to install a mail server and an OpenSSH server, all the other parts are automatically installed for you.

GitLab will auto configure itself with the recommended settings. If you want to change your configuration, you have to first create the configuration file. You can do this as follows:

$ sudo mkdir -p /etc/gitlab
$ sudo touch /etc/gitlab/gitlab.rb
$ sudo chmod 600 /etc/gitlab/gitlab.rb

The settings that you are most likely to change are the ones that are in the gitlab.yml file (https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example).

You need to make a small translation change in order to make this work, so let's say you want to change the port that GitLab is running on; normally, you would change the port value in the GitLab file, but now you have to add an entry to /etc/gitlab/gitlab.rb.

So, for the port, the entry in gitlab.yml would look like the following code:

production: &base
  gitlab:
    port: 80

In the gitlab.rb file, you need to create the following entry: gitlab_rails['port'] = 80.

Left arrow icon Right arrow icon

Key benefits

What you will learn

Install and maintain your GitLab instance Work with multiple users, create groups, and configure your project visibility Secure your code with the correct GitLab configuration Make the most of the builtin issue tracker, including merge requests Manage your projects through the GitLab API Set up webhooks and system hooks to receive notifications Manage your GitLab server using LDAP

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Buy Now

Product Details


Publication date : Dec 24, 2014
Length 172 pages
Edition : 1st Edition
Language : English
ISBN-13 : 9781783986842

Table of Contents

16 Chapters
GitLab Cookbook Chevron down icon Chevron up icon
Credits Chevron down icon Chevron up icon
About the Author Chevron down icon Chevron up icon
About the Reviewers Chevron down icon Chevron up icon
www.PacktPub.com Chevron down icon Chevron up icon
Preface Chevron down icon Chevron up icon
1. Introduction and Installation Chevron down icon Chevron up icon
2. Explaining Git Chevron down icon Chevron up icon
3. Managing Users, Groups, and Permissions Chevron down icon Chevron up icon
4. Issue Tracker and Wiki Chevron down icon Chevron up icon
5. Maintaining Your GitLab Instance Chevron down icon Chevron up icon
6. Webhooks, External Services, and the API Chevron down icon Chevron up icon
7. Using LDAP and OmniAuth Providers Chevron down icon Chevron up icon
8. GitLab CI Chevron down icon Chevron up icon
Tips and Tricks Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Filter icon Filter
Top Reviews
Rating distribution
Empty star icon Empty star icon Empty star icon Empty star icon Empty star icon 0
(0 Ratings)
5 star 0%
4 star 0%
3 star 0%
2 star 0%
1 star 0%

Filter reviews by


No reviews found
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.