Install GitLab Runner (Binary)
# Download binary
sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64"
# Give it permissions to execute:
sudo chmod +x /usr/local/bin/gitlab-runner
# Create a GitLab CI user:
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
# Install and run as service:
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
Run GitLab Runner in Docker
docker run -d --name gitlab-runner --restart always \
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
sudo docker run -d --name gitlab-runner --restart always \
-v /home/devops/gitlab-runner/config:/etc/gitlab-runner \
-v /var/run/docker.sock:/var/run/docker.sock \
gitlab/gitlab-runner:latest
How to Install GitLab CE in a disconnected environment
- Download the package from: https://packages.gitlab.com/gitlab/gitlab-ce
- click on the RPM link for the OS and download the RPM file.
$ wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/el/8/gitlab-ce-14.5.2-ce.0.el8.x86_64.rpm/download.rpm
-
And transfer to server.
- Follow https://about.gitlab.com/install for the instructions
- enable repos needed
- install dependencies
$ sudo dnf install -y \
curl \
policycoreutils \
openssh-server \
perl \
postfix \
openssl \
tzdata \
yum-utils
# Enable OpenSSH server daemon if not enabled: sudo systemctl status sshd
sudo systemctl enable sshd
sudo systemctl start sshd
# Check if opening the firewall is needed with: sudo systemctl status firewalld
$ sudo firewall-cmd --permanent --add-service=http && \
sudo firewall-cmd --permanent --add-service=https && \
sudo systemctl reload firewalld
Postfix
$ sudo dnf install postfix && \
sudo systemctl enable postfix && \
sudo systemctl start postfix
Install Git
- make sure RHEL repos are enabled (local or satellite)
$ sudo EXTERNAL_URL="http://gitlab.lab.local" \
GITLAB_ROOT_PASSWORD="gitlabadmin" \
dnf localinstall -y gitlab-ce-14.5.2-ce.0.el8.x86_64.rpm
Note:
- If any error with gpgchec, then disable gpgcheck by adding
--nogpgcheck
at the end ofdnf
oryum
command. - If you missed to mention the
root
password while installing, then get the default randomg password generated by installaer. (This password will be removed bygitlab-ctl reconfigure
later.)
$ sudo cat /etc/gitlab/initial_root_password