1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

gitlab EEをデプロイする

Last updated at Posted at 2024-11-18

チーム内の活動でローカルのGitlabを建てることになったので勉強がてらメモしつつ書いておく。

前提

1.Linuxインスタンス上にインストールする
2.gitlab社が用意しているスクリプトを使う
3.(余裕があれば、今後ほかのデプロイ方法を試す)
4. HW的なRequirementは下記を参照。
https://docs.gitlab.com/ee/install/requirements.html
5.ホスト名はgitlab.yourdomain.local、 IPアドレスを決め打ち、DNSに事前登録済み
6.Linux仮想マシンのバージョンは以下

[user@yourmachine ~]$ cat /etc/redhat-release 
CentOS Stream release 9

作業手順

gitlabインスタンスが名前解決できているか確認

[user@yourmachine ~]$ host gitlab.homelab.local
gitlab.yourdomain.local has address xxx.xxx.xxx.xxx

周辺ツールインストール

[user@yourmachine ~]$sudo dnf install -y curl policycoreutils openssh-server perl
[user@yourmachine ~]$sudo dnf install -y postfix
[user@yourmachine ~]$postconf | grep mail_version
[user@yourmachine ~]$sudo systemctl enable postfix.service
[user@yourmachine ~]$sudo systemctl start postfix

スクリプトダウンロード&実行.

[user@yourmachine ~]$curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

スクリプトの実行結果確認

[user@yourmachine ~]$cat /etc/yum.repos.d/gitlab_gitlab-ee.repo
[gitlab_gitlab-ee]
name=gitlab_gitlab-ee
baseurl=https://packages.gitlab.com/gitlab/gitlab-ee/el/9/$basearch
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

[gitlab_gitlab-ee-source]
name=gitlab_gitlab-ee-source
baseurl=https://packages.gitlab.com/gitlab/gitlab-ee/el/9/SRPMS
repo_gpgcheck=1
gpgcheck=1
enabled=1
gpgkey=https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey
       https://packages.gitlab.com/gitlab/gitlab-ee/gpgkey/gitlab-gitlab-ee-3D645A26AB9FBD22.pub.gpg
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300

gitlab-eeインストール

 [user@yourmachine ~]$sudo $EXTERNAL_URL="https://gitlab.yourdomain.local" dnf install gitlab-ee-16.1.4

追加手順(要確認)

なぜか変数 external_url を設定できていない。
gitlab.rb を編集し、
external_url 'http://gitlab.exmaple.com'となっている部分を'https://yourdomain.local'に書き換える

ダウンロードメッセージは必ず確認する。

[user@yourmachine ~]$sudo vi /etc/gitlab/gitlab.rb
## GitLab URL
##! URL on which GitLab will be reachable.
##! For more details on configuring external_url see:
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab
##!
##! Note: During installation/upgrades, the value of the environment variable
##! EXTERNAL_URL will be used to populate/replace this value.
##! On AWS EC2 instances, we also attempt to fetch the public hostname/IP
##! address from AWS. For more details, see:
##! https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
external_url 'http://gitlab.exmaple.com'
↑↑ 上を修正 ↑↑

アクセスの確認

Webブラウザで"https://gitlab.yourdomain.local"にアクセス。

image.png

以上。お疲れ様でした。

参考文献

GitLab実践ガイド第2版 impress top gearシリーズ
GitLab Self-Managedのインストール

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?