Skip to content

Latest commit

 

History

History
217 lines (145 loc) · 6.34 KB

index.md

File metadata and controls

217 lines (145 loc) · 6.34 KB

Install, set up, and update GDK

🚨Note: Before undertaking these steps, be sure you have prepared your system.🚨

To get GDK up and running:

  1. Install the gitlab-development-kit gem
  2. Initialize a new GDK directory
  3. Install GDK components

Install the gitlab-development-kit gem

Execute the following with the Ruby version manager of your choice (rvm, rbenv, chruby, etc.) with the current gitlab Ruby version:

gem install gitlab-development-kit

Initialize a new GDK directory

  1. Change into the directory where you want to store your source code for GitLab projects (e.g. ~/workspace). The path used for GDK must contain only alphanumeric characters.

  2. To initialize GDK into:

    • The default directory (./gitlab-development-kit), run:

      gdk init
    • A custom directory, pass a directory name. For example, to initialize into the gdk directory, run:

      gdk init gdk

Install GDK components

  1. Change into the newly created GDK directory. For example:

    cd gdk
  2. Install the necessary components (repositories, Ruby gem bundles, and configuration) using gdk install.

Develop against the GitLab project (default)

Use gdk install shallow_clone=true for a faster clone that consumes less disk-space. The clone will be done using git clone --depth=1.

Develop against the GitLab FOSS project

Learn how to create a fork of GitLab FOSS.

  • HTTP, run:

    gdk install gitlab_repo=https://gitlab.com/gitlab-org/gitlab-foss.git
  • SSH, run:

    gdk install [email protected]:gitlab-org/gitlab-foss.git

Use gdk install shallow_clone=true for a faster clone that consumes less disk-space. The clone will be done using git clone --depth=1.

Develop in your own GitLab fork

Learn how to create a fork of GitLab.

  • HTTP, run:

    # Replace <YOUR-NAMESPACE> with your namespace
    gdk install gitlab_repo=https://gitlab.com/<YOUR-NAMESPACE>/gitlab.git
    support/set-gitlab-upstream
  • SSH, run:

    # Replace <YOUR-NAMESPACE> with your namespace
    gdk install [email protected]:<YOUR-NAMESPACE>/gitlab.git
    support/set-gitlab-upstream

The set-gitlab-upstream script creates a remote named upstream for the canonical GitLab repository. It also modifies gdk update (See Update GitLab) to pull down from the upstream repository instead of your fork, making it easier to keep up-to-date with the project.

If you want to push changes from upstream to your fork, run gdk update and then git push origin from the gitlab directory.

Map gdk.test host name to localhost

Set up a GDK-specific host name for convenience. For example, add the following to /etc/hosts:

127.0.0.1 gdk.test

The host name gdk.test is now available for documentation steps and GDK tools.

Common errors during installation and troubleshooting

During gdk install process, you may encounter some dependencies related errors. Please refer to the Troubleshooting page or open an issue on GDK tracker if you get stuck.

GitLab Enterprise Features

Instructions to generate a developer license can be found in the onboarding documentation.

The license key generator is only available for GitLab team members, who should use the "Sign in with GitLab" link using their dev.gitlab.org account.

Post-installation

Start GitLab and all required services:

gdk start

To stop the Rails app, which saves memory (useful when running tests):

gdk stop rails

To access GitLab, you may now go to http://localhost:3000 in your browser. It may take a few minutes for the Rails app to be ready. During this period you would see dial unix /Users/.../gitlab.socket: connect: connection refused in the browser.

The development login credentials are root and 5iveL!fe.

GDK comes with a number of settings, and most users will use the default values, but you are able to override these in gdk.yml in the GDK root.

For example, to change the port you can set this in your gdk.yml:

port: 3001

And run the following command to apply:

gdk reconfigure

You can find a bunch of other settings that are configurable in gdk.example.yml.

Read the configuration document for more details.

After installation learn how to use GDK enable other features.

Running GitLab and GitLab FOSS concurrently

To have multiple GDK instances running concurrently, for example to test GitLab and GitLab FOSS, initialize each into a separate GDK folder. To run them simultaneously, make sure they don't use conflicting port numbers.

You can for example use the following gdk.yml in one of both GDKs.

port: 3001
webpack:
  port: 3809
gitlab_pages:
  port: 3011

Update GDK

To update an existing GDK installation, run the following commands:

cd <gdk-dir>
gdk update
gdk reconfigure