#git #jenkins #permissions
#git #дженкинс #разрешения
Вопрос:
Нужна помощь с этим. Пытался найти решения похожих проблем, но не нашел ничего, что работает.
Мой конвейер выполняется нормально в первый раз, хотя при второй сборке я получаю именно эту ошибку "git clean -ffdx" returned status code 1
…
using credential github
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/XXXXX/XXXXXX.git # timeout=10
Cleaning workspace
> git rev-parse --verify HEAD # timeout=10
Resetting working tree
> git reset --hard # timeout=10
> git clean -ffdx # timeout=10
ERROR: Error fetching remote repo 'origin'
hudson.plugins.git.GitException: Failed to fetch from https://github.com/XXXXXX/XXXXXX.git
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:915)
at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1141)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1177)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93)
at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80)
at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: hudson.plugins.git.GitException: Command "git clean -ffdx" returned status code 1:
stdout:
stderr: warning: failed to remove 1/src/build/table_select_window/PYZ-00.toc: Permission denied
warning: failed to remove 1/src/build/table_select_window/xref-table_select_window.html: Permission denied
warning: failed to remove 1/src/build/table_select_window/EXE-00.toc: Permission denied
warning: failed to remove 1/src/build/table_select_window/Analysis-00.toc: Permission denied
warning: failed to remove 1/src/build/table_select_window/PKG-00.pkg: Permission denied
warning: failed to remove 1/src/build/table_select_window/PKG-00.toc: Permission denied
warning: failed to remove 1/src/build/table_select_window/PYZ-00.pyz: Permission denied
warning: failed to remove 1/src/build/table_select_window/warn-table_select_window.txt: Permission denied
warning: failed to remove 1/src/build/table_select_window/base_library.zip: Permission denied
warning: failed to remove 1/src/dist/table_select_window: Permission denied
warning: failed to remove 1/src/__pycache__/table_select_window.cpython-37.pyc: Permission denied
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2437)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2367)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:2363)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1923)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommand(CliGitAPIImpl.java:1935)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clean(CliGitAPIImpl.java:1017)
at hudson.plugins.git.extensions.impl.CleanBeforeCheckout.decorateFetchCommand(CleanBeforeCheckout.java:45)
at hudson.plugins.git.extensions.GitSCMExtension.decorateFetchCommand(GitSCMExtension.java:288)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:911)
... 11 more
Error fetching remote repo 'origin'
Я попытался перезапустить свой компьютер, а также включить «очистить перед оформлением заказа» в Дженкинсе, но безуспешно. Я запускаю Windows 10 и jenkins через docker. Любая помощь приветствуется.
Спасибо.
Комментарии:
1. вы добились чего-нибудь с этим, у меня такая же проблема
2. К сожалению, я не
Ответ №1:
Чтобы предотвратить это в будущих сборках, вы можете добавить следующее в свой jenkinsfile (для запуска после всех этапов).
post
{
always
{
yumCleanUp()
cleanWs()
}
}
Комментарии:
1. Обратите внимание, что для запуска плагина требуется очистка рабочего пространства
cleanWs()
.