本文介绍了GitLab Runner不参与特定项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我注册了GitLab Runner的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。update git on Centos 7 to version 2 from third-party IUS repo
$ git --version
git version 1.8.3.1
sudo yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
sudo yum install git
这篇关于GitLab Runner不参与特定项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!