🚨Note: Before undertaking these steps, be sure you have prepared your system.🚨
To get GDK up and running:
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
-
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. -
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
-
-
Change into the newly created GDK directory. For example:
cd gdk
-
Install the necessary components (repositories, Ruby gem bundles, and configuration) using
gdk install
.-
For those who have write access to the GitLab.org group we recommend Develop against the GitLab project (default)
-
Other options in order of recommendation:
-
-
HTTP, run:
gdk install
-
SSH, run:
gdk install [email protected]:gitlab-org/gitlab.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
.
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
.
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.
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.
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.
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.
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.
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
To update an existing GDK installation, run the following commands:
cd <gdk-dir>
gdk update
gdk reconfigure