Gitlab CI/CD upload artifact fails: too large

自部署gitlab在进行CI/CD时,出现文件过大问题,三步解决:

第一,admin area

修改:Maximum artifacts size

这一步需要gitlab的管理员账户,左上角admin area settings, 然后左下角settings->CI/CD settings

修改 Maximum artifacts size
Gitlab CI/CD upload artifact fails: too large_第1张图片

第二,修改gitlab.rb配置文件

sudo vi /etc/gitlab/gitlab.rb

找到

nginx['client_max_body_size'] = '250m'

然后:

gitlab-ctl reconfigure

第三,如果用了nginx反向代理,也要改

在nginx配置中加入

client_max_body_size 0;

如下:

server {
    listen 80;
    server_name git.pauledenburg.com;
    client_max_body_size 0;

    location / {
        proxy_pass http://localhost:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

nginx重新加载配置

你可能感兴趣的:(乱七八糟,gitlab,nginx,ci/cd)