你问的“Linux GitLab 怎样集成”,通常有两种理解:
下面我分别说明,你可以按需看。
支持系统:
建议配置:
sudo apt update
sudo apt install -y curl openssh-server ca-certificates
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | sudo bash
sudo EXTERNAL_URL="http://gitlab.example.com" apt install gitlab-ce
sudo gitlab-ctl reconfigure
浏览器访问:
http://服务器IP
gitlab-ctl status
gitlab-ctl restart
gitlab-ctl tail
GitLab 自带 Runner:
# 安装 gitlab-runner
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh | sudo bash
sudo apt install gitlab-runner
注册 Runner:
sudo gitlab-runner register
填写:
示例 .gitlab-ci.yml:
stages:
- build
- deploy
build:
stage: build
script:
- echo "building..."
deploy:
stage: deploy
script:
- sh deploy.sh
路径:
项目 → Settings → Webhooks
示例(通知 Linux 脚本):
{
"object_kind": "push"
}
接收端可用:
修改配置文件:
sudo vi /etc/gitlab/gitlab.rb
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-EOS
main:
label: 'LDAP'
host: 'ldap.example.com'
port: 389
uid: 'cn'
bind_dn: 'cn=admin,dc=example,dc=com'
password: 'password'
base: 'dc=example,dc=com'
EOS
sudo gitlab-ctl reconfigure
docker executor请告诉我你具体想集成什么,例如:
我可以给你具体步骤和配置示例。