From 7c0e112d28e13f91c48e261b82d957f7465464d9 Mon Sep 17 00:00:00 2001 From: "Ivan I. Ovchinnikov" Date: Thu, 25 Dec 2025 20:35:54 +0000 Subject: [PATCH] feat: init repo for gitlab iac --- .gitignore | 3 +++ docker-compose.yaml | 35 +++++++++++++++++++++++++++++ gitlab.env.example | 32 ++++++++++++++++++++++++++ runner-config/config.toml.example | 31 +++++++++++++++++++++++++ runner-config/repo.nstart.local.crt | 22 ++++++++++++++++++ 5 files changed, 123 insertions(+) create mode 100644 .gitignore create mode 100644 docker-compose.yaml create mode 100644 gitlab.env.example create mode 100644 runner-config/config.toml.example create mode 100644 runner-config/repo.nstart.local.crt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b5d9de6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +git-data/ +gitlab.env +runner-config/config.toml diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..c30eb1d --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,35 @@ +services: + gitlab: + image: 'gitlab/gitlab-ce:latest' + restart: always + hostname: 'gitlab.nstest.local' + container_name: gitlab-ce + env_file: + - gitlab.env + ports: + - '8586:8081' + - '8545:443' + - '8090:8090' + - '22:22' + volumes: + - '$GITLAB_HOME/config:/etc/gitlab' + - '$GITLAB_HOME/logs:/var/log/gitlab' + - '$GITLAB_HOME/data:/var/opt/gitlab' + networks: + - gitlab + + gitlab-runner: + image: gitlab/gitlab-runner:latest + container_name: gitlab-runner + restart: always + user: root + depends_on: + - gitlab + volumes: + - ./runner-config:/etc/gitlab-runner + - /var/run/docker.sock:/var/run/docker.sock + networks: + - gitlab + +networks: + gitlab: diff --git a/gitlab.env.example b/gitlab.env.example new file mode 100644 index 0000000..a3065ad --- /dev/null +++ b/gitlab.env.example @@ -0,0 +1,32 @@ +GITLAB_OMNIBUS_CONFIG=" + external_url = 'https://gitlab.nstest.local' + nginx['listen_port'] = 8081 + nginx['listen_https'] = false + gitlab_rails['omniauth_enabled'] = true + gitlab_rails['omniauth_allow_single_sign_on'] = true + gitlab_rails['omniauth_auto_sing_in_with_provider'] = 'openid_connect' + gitlab_rails['omniauth_block_auto_created_users'] = false + gitlab_rails['omniauth_auto_link_ldap_user'] = false + gitlab_rails['omniauth_auto_link_user'] = ['openid_connect'] + gitlab_rails['gitlab_ssh_host'] = 'ssh.gitlab.nstest.local' + gitlab_rails['omniauth_providers'] = [{ + name: 'openid_connect', + label: 'Новый Старт ID', + args: { + name: 'openid_connect', + scope: %w[openid profile email], + response_type: 'code', + issuer: 'https://auth.nstart.space/realms/nstart', + discovery: true, + client_auth_method: 'basic', + uid_field: 'preferred_username', + pkce: false, + client_options: { + identifier: 'gitlab', + secret: '', + redirect_uri: 'https://gitlab.nstest.local/users/auth/openid_connect/callback', + } + } + }] + +" diff --git a/runner-config/config.toml.example b/runner-config/config.toml.example new file mode 100644 index 0000000..e294da1 --- /dev/null +++ b/runner-config/config.toml.example @@ -0,0 +1,31 @@ +concurrent = 5 +check_interval = 0 +shutdown_timeout = 0 + +[session_server] + session_timeout = 1800 + +[[runners]] + name = "docker-nstest" + url = "http://gitlab-ce:8081" + id = 1 + token = "" + token_obtained_at = 2025-11-01T14:59:32Z + token_expires_at = 0001-01-01T00:00:00Z + executor = "docker" + [runners.cache] + MaxUploadedArchiveSize = 0 + [runners.cache.s3] + [runners.cache.gcs] + [runners.cache.azure] + [runners.docker] + tls_verify = false + image = "debian:stable" + privileged = true + disable_entrypoint_overwrite = false + oom_kill_disable = false + disable_cache = false + volumes = ["/home/ivan/docker/git/git-data/gitlab-runner/config/repo.nstart.local.crt:/etc/docker/certs.d/repo.nstart.local/ca.crt:ro", "/cache"] + shm_size = 0 + network_mtu = 0 + extra_hosts = ["gitlab.nstest.local:192.168.103.13"] diff --git a/runner-config/repo.nstart.local.crt b/runner-config/repo.nstart.local.crt new file mode 100644 index 0000000..9e42afc --- /dev/null +++ b/runner-config/repo.nstart.local.crt @@ -0,0 +1,22 @@ +-----BEGI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