This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
инструмент_gitlab [2025/12/15 09:39] val [Установка через docker-compose] |
инструмент_gitlab [2026/02/09 14:21] (current) val [Пример shell ansible] |
||
|---|---|---|---|
| Line 78: | Line 78: | ||
| * [[https://galaxy.ansible.com/ui/repo/published/hifis/toolkit/content/role/gitlab/]] | * [[https://galaxy.ansible.com/ui/repo/published/hifis/toolkit/content/role/gitlab/]] | ||
| + | |||
| + | |||
| ===== Подключение ===== | ===== Подключение ===== | ||
| Line 148: | Line 150: | ||
| <code> | <code> | ||
| ### docker exec -it root_web_1 bash | ### docker exec -it root_web_1 bash | ||
| + | ### kubectl -n my-gitlab-ns exec -ti pods/gitlab-<TAB> -- bash | ||
| + | |||
| + | # ###gitlab-ctl status | ||
| + | |||
| + | # ###gitlab-rake gitlab:check | ||
| # gitlab-ctl show-config | # gitlab-ctl show-config | ||
| Line 156: | Line 163: | ||
| ... | ... | ||
| </code> | </code> | ||
| + | ==== Настройка отправки почты ==== | ||
| + | * [[Утилита msmtp#sendmail без mta]] | ||
| + | <code> | ||
| + | root@gitlab:/# gitlab-rails console | ||
| + | irb(main):001> Notify.test_email('student@corp15.un', 'Message Subject', 'Message Body').deliver_now | ||
| + | </code> | ||
| ==== GitLab Docker Registry ==== | ==== GitLab Docker Registry ==== | ||
| Line 444: | Line 457: | ||
| <code> | <code> | ||
| - | Settings -> CI/CD -> Variables -> Add variable -> Masked and hidden ... ANS_V_SEC | + | Settings -> CI/CD -> Variables -> Add variable -> Masked and hidden ... ANS_V_SEC или VAULT_ADDR/VAULT_TOKEN |
| снять Protect variable | снять Protect variable | ||
| Line 451: | Line 464: | ||
| </code> | </code> | ||
| <code> | <code> | ||
| - | Administrator@Ra-master ~/openvpn1 (test) | + | ~/openvpn1# cat .gitlab-ci.yml |
| - | λ touch .gitlab-ci.yml | + | |
| или | или | ||
| Build -> Pipeline editor -> Configure Pipelines | Build -> Pipeline editor -> Configure Pipelines | ||
| Line 464: | Line 476: | ||
| - ansible-playbook openvpn1.yaml -i inventory.yaml -e "variable_host=test_nodes" | - ansible-playbook openvpn1.yaml -i inventory.yaml -e "variable_host=test_nodes" | ||
| # - echo $ANS_V_SEC | ansible-playbook openvpn1.yaml -i inventory2.yaml --vault-password-file=/bin/cat -e "variable_host=test_nodes" | # - echo $ANS_V_SEC | ansible-playbook openvpn1.yaml -i inventory2.yaml --vault-password-file=/bin/cat -e "variable_host=test_nodes" | ||
| + | # - sops exec-file --no-fifo inventory.yaml 'ansible-playbook openvpn1.yaml -i {} -e "variable_host=test_nodes"' | ||
| tags: | tags: | ||
| - ansible | - ansible | ||
| Line 474: | Line 487: | ||
| - ansible-playbook openvpn1.yaml -i inventory.yaml | - ansible-playbook openvpn1.yaml -i inventory.yaml | ||
| # - echo $ANS_V_SEC | ansible-playbook openvpn1.yaml -i inventory2.yaml --vault-password-file=/bin/cat | # - echo $ANS_V_SEC | ansible-playbook openvpn1.yaml -i inventory2.yaml --vault-password-file=/bin/cat | ||
| + | # - sops exec-file --no-fifo inventory.yaml 'ansible-playbook openvpn1.yaml -i {}' | ||
| tags: | tags: | ||
| - ansible | - ansible | ||
| Line 646: | Line 660: | ||
| * [[https://akyriako.medium.com/build-golang-docker-images-with-gitlab-ci-pipelines-2117f8505350|Build Golang Docker images with GitLab CI Pipelines]] | * [[https://akyriako.medium.com/build-golang-docker-images-with-gitlab-ci-pipelines-2117f8505350|Build Golang Docker images with GitLab CI Pipelines]] | ||
| * [[https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/|Best practices for building docker images with GitLab CI]] | * [[https://blog.callr.tech/building-docker-images-with-gitlab-ci-best-practices/|Best practices for building docker images with GitLab CI]] | ||
| + | |||
| + | * [[https://habr.com/ru/articles/764568/|Настройка CI/CD для Gitlab-репозитория: схемы и гайд по шагам (на примере Spring Boot-приложения)]] | ||
| * [[https://stackoverflow.com/questions/63693061/how-to-run-a-script-from-file-in-another-project-using-include-in-gitlab-ci|How to run a script from file in another project using include in GitLab CI?]] | * [[https://stackoverflow.com/questions/63693061/how-to-run-a-script-from-file-in-another-project-using-include-in-gitlab-ci|How to run a script from file in another project using include in GitLab CI?]] | ||
| Line 667: | Line 683: | ||
| #variables: | #variables: | ||
| # DOCKER_TLS_CERTDIR: "" | # DOCKER_TLS_CERTDIR: "" | ||
| + | # KANIKO_REGISTRY_MIRROR: "mirror.gcr.io" | ||
| #services: | #services: | ||
| - | # - name: docker:dind | + | # - name: docker:20.10.24-dind |
| # command: | # command: | ||
| # [ | # [ | ||
| - | # '--insecure-registry=server.corpX.un:5000', | + | # '--insecure-registry=server.corpX.un:5000','--registry-mirror=https://mirror.gcr.io', |
| # ] | # ] | ||
| Line 818: | Line 835: | ||
| gitlab_rails['omniauth_providers'] = [ | gitlab_rails['omniauth_providers'] = [ | ||
| { | { | ||
| - | name: "openid_connect", # do not change this parameter | + | name: "openid_connect", |
| - | label: "Keycloak", # optional label for login button, defaults to "Openid Connect" | + | label: "Keycloak", |
| args: { | args: { | ||
| name: "openid_connect", | name: "openid_connect", | ||