我注册了GitLab运行程序的11个项目。除1个项目外,每个项目的跑步者都可以正常工作。我第一次注册该项目的执行者,它可以工作。但是在我提交/推送一些更改后,会发生错误并且作业失败。我看到一些升级git版本的解决方案可以解决问题,但是我不这么认为。因为除此项目外,所有跑步者都可以正常工作。
服务器操作系统:CentOS 7
git:1.8.3.1
First time registered runner
>Running with gitlab-runner 11.9.2 (...)
on (...)
Using Shell executor...
Running on localhost.localdomain...
Initialized empty Git repository in /home/gitlab-runner/(...)/.git/
Clean repository
Fetching changes with git depth set to 50...
Created fresh repository.
From https://gitlab.com/(...)
* [new branch] master -> origin/master
Checking out (...) as master...
Skipping Git submodules setup
$ echo "> gitlab-ci started"
> gitlab-ci started
$ cd /home/(..)
$ echo "> git pull started"
> git pull started
$ git pull
remote: Total 0 (delta 0), reused 0 (delta 0)
Already up-to-date.
Job succeeded
第二次提交/拉动,然后
>Running with gitlab-runner 11.9.2 (...)
on (...)
Using Shell executor...
Running on localhost.localdomain...
Reinitialized existing Git repository in /home/gitlab-runner/(...)/.git/
Clean repository
Fetching changes with git depth set to 50...
fatal: remote origin already exists.
fatal: git fetch-pack: expected shallow list
ERROR: Job failed: exit status 1
编辑。这是我的.gitlab-ci.yml
stages:
- deploy
deploy_to_master:
stage: deploy
script:
- echo "> gitlab-ci started"
- cd /home/www/dir
- echo "> git pull started"
- git pull
- echo "> permission set"
- chmod 707 -R ./data/
- chmod 707 -R ./plugin/nice/
- chmod 707 ./favicon.ico
- echo "> server reload(=httpd -k graceful)"
- systemctl reload httpd
only:
- master
tags:
- tags
Centos 7附带git版本1.8.3.1。此版本不支持git fetch-pack之类的命令。要解决此问题,您可以从IUS存储库更新服务器上的git。从第三方IUS存储库将Centos 7上的git更新到版本2
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句