User Tools

Site Tools


инструмент_gitlab

This is an old revision of the document!


Инструмент GitLab

Установка

Настройка

# cat /etc/gitlab/gitlab.rb

GitLab Runner

root@node2:~# gitlab-runner register
shell

root@node2:~# cat /etc/gitlab-runner/config.toml
log_level = "debug"
...
root@node2:~# systemctl start gitlab-runner

GitLab CI/CD

vagrant@node1:~/project1$ cat .gitlab-ci.yml
#before_script:
#  - echo $(date) "Before script section" >> /tmp/Bash.gitlab-ci.log

#after_script:
#  - echo $(date) "After script section" >> /tmp/Bash.gitlab-ci.log

test1:
  stage: test
  script:
    - echo $(date) "Do a test here" >> /tmp/Bash.gitlab-ci.log
    - shellcheck webd/webd
  tags:
    - shellcheck

deploy1:
  stage: deploy
  script:
    - echo $(date) "Do your deploy here" >> /tmp/Bash.gitlab-ci.log
    - docker-compose up -d
  tags:
    - webddeploy

Управление пользователями

Использование LDAP

# cat /etc/gitlab/gitlab.rb
...
gitlab_rails['ldap_enabled'] = true

gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
  main:
    label: 'LDAP'
    host: 'server.corpX.un'
    port: 389
#    port: 636
    uid: 'uid'
    bind_dn: 'cn=admin,dc=corpX,dc=un'
    password: 'secret'
    encryption: 'plain'
#    encryption: 'simple_tls'
    active_directory: false
    base: 'ou=People,dc=corpX,dc=un'
...
# gitlab-ctl reconfigure

Сервер OAuth2

  • !!! URL без финального “/” !!!
Admin Area-> Applications-> val-auth-test
  Callback URL: https://val.bmstu.ru/auth-test
  Trusted: Yes
инструмент_gitlab.1655273893.txt.gz · Last modified: 2022/06/15 09:18 by val