标签:key git and with ase lda use logs etc
gitlab 容器化部署1. docker pull 对应的版本的容器
[https://hub.docker.com/r/gitlab/gitlab-ce/]()
通过Dockerfile 查看需要挂载的文件目录有
/etc/gitlab 配置文件
/var/log/gitlab 日志
/var/opt/gitlab 数据文件
2. 使用容器启动
docker run -d -p 80:80 -p 443:443 -p 22:22 --name gitlab --restart unless-stopped -v /data/gitlab/config:/etc/gitlab -v /data/gitlab/logs:/var/log/gitlab -v /data/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:10.7.3-ce
3. 配置https
external_url ‘https://gitlab.xxx.com‘
nginx[‘redirect_http_to_https‘] = true
nginx[‘ssl_certificate‘] = "/etc/gitlab/ssl/gitlab.example.com.crt"
nginx[‘ssl_certificate_key‘] = "/etc/gitlab/ssl/gitlab.example.com.key"
4. 配置Ldap
gitlab_rails[‘ldap_enabled‘] = true
###! **remember to close this block with ‘EOS‘ below**
gitlab_rails[‘ldap_servers‘] = YAML.load <<-‘EOS‘
main:
label: ‘LDAP‘
host: ‘xxxxxxxxxxxx‘
port: 389
uid: ‘uid‘
bind_dn: ‘uid=xxxxx,cn=xxxx,dc=xxx,dc=xxx‘
password: ‘xxxxx‘
encryption: ‘plain‘
verify_certificates: false
active_directory: true
base: ‘DC=xxxx,DC=xxxxx’
admin_group: ‘Global Admins‘
EOS
5. 配置邮件
gitlab_rails[‘smtp_enable‘] = true
gitlab_rails[‘smtp_address‘] = ""
gitlab_rails[‘smtp_port‘] = 25
gitlab_rails[‘smtp_user_name‘] = ""
gitlab_rails[‘smtp_password‘] = ""
gitlab_rails[‘smtp_domain‘] = ""
gitlab_rails[‘smtp_authentication‘] = false
gitlab_rails[‘smtp_enable_starttls_auto‘] = true
gitlab_rails[‘smtp_tls‘] = false
gitlab_rails[‘gitlab_email_enabled‘] = true
gitlab_rails[‘gitlab_email_from‘] = ‘notify@ennew.cn‘
gitlab_rails[‘gitlab_email_display_name‘] = ‘Gitlab ‘
6. 重新加载配置
gitlab-ctl reconfigure 使配置文件生效
7. 备份
docker exec gitlab gitlab-rake gitlab:backup:create
8. gitlab 权限管理
Guest 可以创建issue 发表评论 不能读写版本库
Reporter 可以克隆代码 不能提交 QA ,PM可以赋予这个权限
Developer 可以克隆代码、 开发 提交 push,RD 可以赋予这个权限
Master 可以创建项目 添加tag 保护分支 添加项目成员 编辑项目,核心RD负责人可以赋予这个权限
owner 可以设置项目访问权限,删除项目 迁移项目 管理组成员 开发组leader 可以赋予这个权限
需要设置 "allow_local_requests_from_hooks_and_services":true,
curl -X GET --header "PRIVATE-TOKEN: xxxxxxxx" ‘http://10.39.15.24/api/v4/application/settings?‘
curl -X PUT --header "PRIVATE-TOKEN: DWpr1Q2dsJzQZmjDXMny" ‘https://gitlab.enncloud.cn/api/v4/application/settings?allow_local_requests_from_hooks_and_services=true‘ | grep allow
标签:key git and with ase lda use logs etc
原文地址:http://blog.51cto.com/xiaocainiaox/2141024