You are previewing GitLab Cookbook.
O'Reilly logo
GitLab Cookbook

Book Description

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

In Detail

GitLab is a popular, open source Git hosting solution implemented by more than 50,000 organizations. This book has some carefully chosen recipes to help you decide on the type of GitLab installation that will fit your requirements. Along with covering some of the basic principles of Git, the book covers practical scenarios to show how you or your organization can effectively manage your proprietary code.

You will learn how to manage multiple users, groups, and the permissions GitLab has for them. Updating your GitLab instance, creating backups, and restoring backups are a few of the important tasks described in detail to assist you in maintaining your GitLab server. Moreover, the GitLab API is extensively covered to guide you through the various operations to manage your project.

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 built-in 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
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. GitLab Cookbook
      1. Table of Contents
      2. GitLab Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Errata
          2. Piracy
          3. Questions
      8. 1. Introduction and Installation
        1. Introduction
        2. Using the Omnibus package
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Setting up the server dependencies for source installation
          1. How to do it…
          2. How it works…
        4. Set up the database for source installation
          1. How to do it…
        5. Installing GitLab from source
          1. Getting ready
          2. How to do it…
          3. How it works…
        6. Using Chef and GitLab Cookbook
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Logging in for the first time
          1. How to do it…
          2. How it works…
        8. Creating your first project
          1. How to do it…
      9. 2. Explaining Git
        1. Introduction
        2. Generating your SSH key on Unix-like systems
          1. How to do it…
          2. How it works…
        3. Generating your SSH key on Windows
          1. How to do it…
          2. How it works…
        4. Adding your SSH key to GitLab
          1. How to do it…
          2. How it works…
        5. Creating your first Git project
          1. How to do it…
          2. How it works…
        6. Cloning your repository and pushing code to it
          1. Getting ready
          2. How to do it…
          3. How it works…
        7. Working with branches
          1. Getting ready
          2. How to do it…
        8. Performing a rebase operation
          1. How to do it…
          2. How it works…
        9. Squashing your commits
          1. How to do it…
          2. How it works…
      10. 3. Managing Users, Groups, and Permissions
        1. Introduction
        2. Adding a user
          1. How to do it…
          2. How it works…
        3. Creating a group
          1. How to do it…
          2. How it works…
        4. Working with user permissions
          1. Getting ready
          2. How to do it…
          3. How it works…
        5. Protecting your main branches
          1. How to do it…
          2. How it works…
        6. Configuring the project's visibility
          1. How to do it…
          2. How it works…
        7. Removing a user
          1. Getting ready
          2. How to do it…
          3. How it works…
      11. 4. Issue Tracker and Wiki
        1. Creating your first issue
          1. Getting ready
          2. How to do it…
          3. How it works…
        2. Creating your first merge request
          1. Getting ready
          2. How to do it…
          3. How it works…
        3. Accepting a merge request
          1. Getting ready
          2. How to do it…
          3. How it works…
        4. Referencing issues
          1. How to do it…
          2. There's more…
        5. Working with milestones
          1. How to do it…
          2. How it works…
        6. Creating your first wiki page
          1. How to do it…
          2. How it works…
        7. Managing your wiki with Gollum
          1. Getting ready
          2. How to do it…
          3. How it works…
      12. 5. Maintaining Your GitLab Instance
        1. Introduction
        2. Updating an Omnibus installation
          1. How to do it…
          2. How it works…
        3. Updating GitLab from a source installation
          1. How to do it…
          2. How it works…
        4. Troubleshooting your GitLab installation
          1. How to do it…
          2. How it works…
        5. Creating a backup
          1. How to do it…
        6. Restoring a backup
          1. Getting ready
          2. How to do it…
        7. Importing an existing repository
          1. How to do it…
          2. How it works…
      13. 6. Webhooks, External Services, and the API
        1. Introduction
        2. Working with external services
          1. How to do it…
          2. There's more…
        3. Using webhooks
          1. How to do it…
          2. How it works…
        4. Using system hooks
          1. How to do it…
        5. Getting your private token for the API
          1. How to do it…
          2. How it works…
        6. Understanding the API status codes
          1. How it works…
        7. Managing your projects via the API
          1. Getting ready
          2. How to do it…
        8. Managing issues via the API
          1. Getting ready
          2. How to do it…
        9. Working with other API resources
        10. Working with the API sudo command
      14. 7. Using LDAP and OmniAuth Providers
        1. Introduction
        2. Setting up your LDAP server
          1. How to do it…
        3. Installing a web interface for LDAP
          1. How to do it…
        4. Adding a user to your LDAP server
          1. How to do it…
          2. How it works…
        5. Configuring GitLab to use LDAP on an Omnibus installation
          1. How to do it…
        6. Configuring GitLab to use LDAP on a source installation
          1. How to do it…
        7. Setting up GitHub as an OmniAuth provider
          1. How to do it…
          2. How it works…
      15. 8. GitLab CI
        1. Introduction to GitLab CI
        2. Installing the dependencies
          1. How to do it…
        3. Installing the coordinator
          1. How to do it…
        4. Installing the web server
          1. How to do it…
        5. Installing a runner
          1. How to do it…
        6. Linking your first project to GitLab CI
          1. How to do it…
        7. Creating a build script
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
        8. Using GitLab CI webhooks
          1. How to do it…
          2. How it works…
      16. A. Tips and Tricks
        1. The power of snippets
        2. Getting involved
        3. Getting help
        4. The GitLab RSS feed
        5. Archiving projects
        6. How to format a good Git commit message
        7. How to change your Git editor
        8. Understanding the anatomy of GitLab
        9. Understanding the differences between GitLab's Community Edition (CE) and Enterprise Edition (EE)
        10. How to fork a project and what is forking?
        11. Understanding the branching workflow
      17. Index