我正在尝试使用 buildkite 创建一个 CI/CD 管道,其中构建步骤在虚拟机 (Ubuntu) 上运行。keytar
但是,一个称为库依赖的 npm 包tedious
会导致管道出现问题。
在使用 buildkite-agent 运行其中一个步骤时,它会尝试清理现有存储库。并且在命令期间,由于错误而git clean -fxdq
无法删除文件。keytar.node
Permission denied
这是该步骤的完整日志:
> Running global environment hook
> Setting up plugins
> Preparing working directory
$ cd /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git remote set-url origin git@bitbucket.org:someorg/some-repo.git
$ git clean -fxdq
warning: failed to remove node_modules/keytar/build/Release/keytar.node: Permission denied
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clean -fxdq`: exit status 1 (Attempt 1/3 Retrying in 2s)
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git clone -v -- git@bitbucket.org:someorg/some-repo.git .
fatal: destination path '.' already exists and is not an empty directory.
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clone -v -- git@bitbucket.org:someorg/some-repo.git .`: exit status 128 (Attempt 2/3 Retrying in 2s)
# Host "bitbucket.org" already in list of known hosts at "/var/lib/buildkite-agent/.ssh/known_hosts"
$ git clone -v -- git@bitbucket.org:someorg/some-repo.git .
fatal: destination path '.' already exists and is not an empty directory.
# Removing /var/lib/buildkite-agent/builds/build-server-1/someorg/some-repo
⚠️ Warning: Checkout failed! Error running `/usr/bin/git clone -v -- git@bitbucket.org:someorg/some-repo.git .`: exit status 128 (Attempt 3/3 Retrying in 2s)
# Skipping artifact upload, no checkout
Error: Error running `/usr/bin/git clone -v -- git@bitbucket.org:someorg/some-repo.git .`: exit status 128
/some-repo
使用命令检查文件夹ls -l
的权限后,权限似乎是drwxr-xr-x
,所有者是buildkite-agent
. 我很难过这个文件如何没有被删除,而所有其他文件都被删除而没有任何问题。