Commit c934e36c authored by Patrick Steinhardt's avatar Patrick Steinhardt Committed by Evan Read

Update source installation to use Git from Gitaly

Currently, there's quite a lot of different places which keep track
about which Git version is required by Gitaly in order to have it
operate correctly. This list is hard to keep current, and naturally
those places have diverged in the path.

To fix this, we're moving towards a single source of truth for the
current Git version, which is going to be Gitaly. To implement this,
Gitaly nowadays provides a "make git" target which automatically builds
a supported configuration of Git and installs it into the desired
location. While not yet done, the vision is that this allows us to
quickly iterate in case there are security vulnerabilities reported or
in case there's a bug in Git which impacts operations.

As a first target, this commit converts our source-based installation
instructions to use this target.
parent f923cc7a
...@@ -135,61 +135,30 @@ sudo apt-get install libkrb5-dev ...@@ -135,61 +135,30 @@ sudo apt-get install libkrb5-dev
### Git ### Git
Make sure you have the right version of Git installed: From GitLab 13.6, we recommend you use the [Git version provided by
Gitaly](https://gitlab.com/gitlab-org/gitaly/-/issues/2729)
that:
```shell - Is always at the version required by GitLab.
# Install Git - May contain custom patches required for proper operation.
sudo apt-get install -y git-core
# Make sure Git is version 2.29.0 or higher (recommended version is 2.29.0)
git --version
```
Starting with GitLab 12.0, Git is required to be compiled with `libpcre2`.
Find out if that's the case:
```shell
ldd $(command -v git) | grep pcre2
```
The output should contain `libpcre2-8.so.0`.
If the system packaged Git is too old or not compiled with `pcre2`, remove it:
```shell
sudo apt-get remove git-core
```
On Ubuntu, install Git from [its official PPA](https://git-scm.com/download/linux):
```shell
# run as root!
add-apt-repository ppa:git-core/ppa
apt update
apt install git
# repeat libpcre2 check as above
```
On Debian, use the following compilation instructions:
```shell ```shell
# Install dependencies # Install dependencies
sudo apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev libpcre2-dev build-essential sudo apt-get install -y libcurl4-openssl-dev libexpat1-dev gettext libz-dev libssl-dev libpcre2-dev build-essential
# Download and compile Git from source # Clone the Gitaly repository
cd /tmp git clone https://gitlab.com/gitlab-org/gitaly.git -b <X-Y-stable> /tmp/gitaly
curl --remote-name --location --progress https://www.kernel.org/pub/software/scm/git/git-2.29.0.tar.gz
echo 'fa08dc8424ef80c0f9bf307877f9e2e49f1a6049e873530d6747c2be770742ff git-2.29.0.tar.gz' | shasum -a256 -c - && tar -xzf git-2.29.0.tar.gz
cd git-2.29.0/
./configure --with-libpcre
make prefix=/usr/local all
# Install into /usr/local/bin
sudo make prefix=/usr/local install
# When editing config/gitlab.yml later, change the git -> bin_path to /usr/local/bin/git # Compile and install Git
cd /tmp/gitaly
sudo make git GIT_PREFIX=/usr/local
``` ```
Replace `<X-Y-stable>` with the stable branch that matches the GitLab version you want to
install. For example, if you want to install GitLab 13.6, use the branch name `13-6-stable`.
When editing `config/gitlab.yml` later, change the `git -> bin_path` to `/usr/local/bin/git`.
### GraphicsMagick ### GraphicsMagick
For the [Custom Favicon](../user/admin_area/appearance.md#favicon) to work, GraphicsMagick For the [Custom Favicon](../user/admin_area/appearance.md#favicon) to work, GraphicsMagick
...@@ -466,22 +435,22 @@ Clone Community Edition: ...@@ -466,22 +435,22 @@ Clone Community Edition:
```shell ```shell
# Clone GitLab repository # Clone GitLab repository
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-foss.git -b X-Y-stable gitlab sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab-foss.git -b <X-Y-stable> gitlab
``` ```
Clone Enterprise Edition: Clone Enterprise Edition:
```shell ```shell
# Clone GitLab repository # Clone GitLab repository
sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab.git -b X-Y-stable gitlab sudo -u git -H git clone https://gitlab.com/gitlab-org/gitlab.git -b <X-Y-stable> gitlab
``` ```
Make sure to replace `X-Y-stable` with the stable branch that matches the Make sure to replace `<X-Y-stable>` with the stable branch that matches the
version you want to install. For example, if you want to install 11.8 you would version you want to install. For example, if you want to install 11.8 you would
use the branch name `11-8-stable`. use the branch name `11-8-stable`.
CAUTION: **Caution:** CAUTION: **Caution:**
You can change `X-Y-stable` to `master` if you want the *bleeding edge* version, but never install `master` on a production server! You can change `<X-Y-stable>` to `master` if you want the *bleeding edge* version, but never install `master` on a production server!
### Configure It ### Configure It
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment