|
|
# Install GitLab and clone GitLab repos via the http ESRF proxy
|
|
|
|
|
|
Your local Git installation will have to tell GitLab it needs to go through `proxy.esrf.fr:3128` when cloning repositories via the usual HTTP(S) `git clone https://username@gitlab.esrf.fr/repo.git`. To do this, a local file has to be updated after the installation of GitLab software.
|
|
|
|
|
|
## Install GitLab
|
|
|
|
|
|
Make sure some requirements are satisfied:
|
|
|
|
|
|
```bash
|
|
|
sudo apt-get install curl openssh-server ca-certificates postfix -y
|
|
|
```
|
|
|
Add the GitLab package server to the sources and install the package:
|
|
|
```bash
|
|
|
curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
|
|
|
sudo apt-get install gitlab-ce
|
|
|
```
|
|
|
|
|
|
### Alternative installation
|
|
|
|
|
|
If for some reason the above does not work, do it manually. First create a GitLab sources file:
|
|
|
```bash
|
|
|
sudo gedit /etc/apt/sources.list.d/gitlab_gitlab-ce.list &
|
|
|
```
|
|
|
And copy the following into it:
|
|
|
```bash
|
|
|
# this file was generated by packages.gitlab.com for
|
|
|
# the repository at https://packages.gitlab.com/gitlab/gitlab-ce
|
|
|
|
|
|
deb https://packages.gitlab.com/gitlab/gitlab-ce/debian/ jessie main
|
|
|
deb-src https://packages.gitlab.com/gitlab/gitlab-ce/debian/ jessie main
|
|
|
```
|
|
|
Import and add the Packagecloud gpg key:
|
|
|
```bash
|
|
|
curl -L "https://packages.gitlab.com/gitlab/gitlab-ce/gpgkey" 2> /dev/null | sudo apt-key add - &>/dev/null
|
|
|
```
|
|
|
Finally install the package:
|
|
|
```bash
|
|
|
sudo apt-get update
|
|
|
sudo apt-get install gitlab-ce
|
|
|
```
|
|
|
Lastly run a first config:
|
|
|
```bash
|
|
|
sudo gitlab-ctl reconfigure
|
|
|
```
|
|
|
## Add the ESRF proxy to GitLab
|
|
|
Add a custom environment variable to be used by GitLab. This is done by modifying the file `/etc/gitlab/gitlab.rb`:
|
|
|
```bash
|
|
|
sudo gedit /etc/gitlab/gitlab.rb &
|
|
|
```
|
|
|
Add the following line in `gitlab.rb`:
|
|
|
```bash
|
|
|
gitlab_rails['env'] = {"http_proxy" => "http://proxy.esrf.fr:3128", "https_proxy" => "https://proxy.esrf.fr:3128"}
|
|
|
```
|
|
|
Restart GitLab for the changes to take effect:
|
|
|
```bash
|
|
|
sudo gitlab-ctl reconfigure
|
|
|
sudo gitlab-ctl restart
|
|
|
``` |
|
|
\ No newline at end of file |