我正在使用 Gitlab Jobs 来部署一个工具。下面的代码会返回
这是
发生了一周的问题(很可能是由于Gitlab 15.0发布引起的)。在此之前,每个作业都毫无问题地“通过”了。现在,在不更改任何内容的情况下,它们全部失败(甚至尝试重新运行旧的“通过”作业也是如此)。
我尝试添加了一些内容。
sudo: command not found
。如果我删除 sudo
,将得到以下结果:W: Failed to fetch http://deb.debian.org/debian/dists/stable/InRelease Could not connect to deb.debian.org:80 (199.232.138.132), connection timed out
W: Failed to fetch http://security.debian.org/debian-security/dists/stable-security/InRelease Could not connect to security.debian.org:80 (151.101.130.132), connection timed out Could not connect to security.debian.org:80 (151.101.66.132), connection timed out Could not connect to security.debian.org:80 (151.101.2.132), connection timed out Could not connect to security.debian.org:80 (151.101.194.132), connection timed out
W: Failed to fetch http://deb.debian.org/debian/dists/stable-updates/InRelease Unable to connect to deb.debian.org:80:
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package latex209-bin
E: Unable to locate package texlive-latex-base
E: Unable to locate package texlive-latex-extra
E: Unable to locate package ant
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 1
这是
.gitlab-ci.yml
文件:stages:
- deploy
variables:
RA_NAME: "My_project"
default:
before_script:
- sudo apt-get update -qq && sudo apt-get install -y latex209-bin texlive-latex-base texlive-latex-extra ant && sudo apt-get install zip unzip
deploy_Default:
stage: deploy
script:
- sh -x deploy.sh "$RA_NAME" "$(cat RA_VERSION)"
artifacts:
paths:
- "${RA_NAME}_$(cat RA_VERSION).zip"
only:
- master
- dev
- tags
发生了一周的问题(很可能是由于Gitlab 15.0发布引起的)。在此之前,每个作业都毫无问题地“通过”了。现在,在不更改任何内容的情况下,它们全部失败(甚至尝试重新运行旧的“通过”作业也是如此)。
我尝试添加了一些内容。
build_image:
script:
- docker build --network host
我尝试了一些类似的配置,但都没有起作用。
现在我的问题是:为什么sudo
没有再像以前那样工作了,而我并没有更改.gitlab-ci.yml
文件呢?我应该怎么做才能解决这个问题。
需要提到的是,这些作业是由only
中提到的分支的提交触发的。我可以通过运行pipeline
或重新运行已经运行过的作业来运行它们。我不知道还有其他的运行方式。所有与Gitlab和Docker相关的工作都是通过Gitlab UI完成的。