Amazon Linux 2023上にGitLabを構築し、GitLab Pagesを有効化する
以前にAmazon Linux 2023 へ GitLab をインストールするというメモを書きました。今回はGitLab Pagesを有効化したGitLabを構築する手順をメモします。
以前にAmazon Linux 2023 へ GitLab をインストールするというメモを書きました。今回はGitLab Pagesを有効化したGitLabを構築する手順をメモします。
以前に以下のメモを書きました。
GitLab Runnerをリポジトリからインストールするとgitlab-runnerユーザで動作するようです。これをrootユーザへ変更する手順をメモします。
GitLabではCI/CDした際、GitLab Pages機能でコンテンツをWebサイトとして公開することが出来ます。今回はCI/CDの際、Material for MkDocsでコンテンツをビルドし、その結果をGitLab Pagesで公開する際のプロジェクトディレクトリ/ファイル構成例をメモしておきます。
GitLabでCLIからパスワード認証フォームを有効化/無効化する方法をメモしておきます。
GitLab Runnerの管理はランナーの管理に書かれています。インストール方法はGitLab Runnerのインストールに書かれていたりするのですが、GitLab Runnerの削除方法は見つけられませんでした。そこで今回はGitLab Runnerの削除方法をメモしておきます。
GitLab では「他の Git サーバ」や「別の GitLab」からデータをインポートすることが出来ます。 Import and migrate groups and projects には以下の記載があります。 SaaS 版の GitLab ではインポート機能がデフォルトで有効化されているようですが、Self-Managed 版の場合は「デフォルトで無効」と書かれています。
The import sources that are available to you by default depend on which GitLab you use:
- GitLab.com: all available import sources are enabled by default.
- GitLab Self-Managed: no import sources are enabled by default and must be enabled.
GitLab can import projects from these supported import sources.
Import source Description Bitbucket Cloud Using Bitbucket.org as an OmniAuth provider, import Bitbucket repositories. Bitbucket Server Import repositories from Bitbucket Server (also known as Stash). FogBugz Import FogBugz projects. Gitea Import Gitea projects. GitHub Import from either GitHub.com or GitHub Enterprise. GitLab export Migrate projects one by one by using a GitLab export file. Manifest file Upload a manifest file. Repository by URL Provide a Git repository URL to create a new project from.
今回は Self-Managed 版で「インポート機能を有効化する」手順をメモします。
先日、Amazon Linux 2023 へ GitLab をインストールする というメモを書きました。 公式サイトの gitlab-sshd によると Omnibus 版 GitLab の場合、GitLab で SCP 機能を有効化する場合は以下の設定をしろ、という記載があります。
gitlab_sshd['enable'] = true
gitlab_sshd['listen_address'] = '[::]:2222' # Adjust the port accordingly
ですが、OS 標準の sshd を TCP/22 以外へ設定し、その代わりに GitLab に TCP/22 を利用させようとしても「GitLab がポートを Listen しない」という事象が起こりました。 この問題を解決するには以下のように capset 実行します。
sudo setcap 'cap_net_bind_service=+ep' /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-sshd
その上で GitLab の設定ファイルである /etc/gitlab/gitlab.rb
へ以下のように設定します。
gitlab_sshd['enable'] = true
gitlab_sshd['listen_address'] = '0.0.0.0:22'
あとは GitLab を再起動します。
sudo gitlab-ctl reconfigure
これで GitLab が TCP/22 を Listen するようになりました。
SaaS 版 GitLab では無く、自身で Linux などへ構築する GitLab Self-Managed 上で Entra ID と SAML 連携し、SSO する為の設定手順をメモしておきます。
以前に以下のメモを書きました。
インストール手順は公式サイトの GitLab Self-Managedのインストール に記載されています。 今回は Amazon Linux 2023 へ GitLab をインストールする手順をメモしておきます。
GitLab をコンテナを使わず、Linux パッケージでインストールする手順をメモしておきます。 今回は Ubuntu 24.04LTS 上にインストールしました。 インストール手順は公式サイトの GitLab Self-Managedのインストール に記載されています。