当前位置:网站首页>fatal: unable to commit credential store: Device or resource busy
fatal: unable to commit credential store: Device or resource busy
2022-07-24 10:09:00 【oneslide】
场景是jenkins需要提取当前commit的tag,运行命令:
$ git fetch --tags -f
fatal: unable to commit credential store: Device or resource busy
出现原因
在devops流水线中,构建job的功能是在kubernetes pod完成的(使用了jenkins kubernetes插件)。
但是git是私有仓库,运行一些git命令需要用户名密码,我用了credential store。
即:
git config --global credential.helper store
这个命令简而言之就是将密码记录到~/.git-credentials文件下。git store插件会将配置写入到/root/.gitconfig.
可以简单看看这两个文件的内容
- .git-credentials
http://root:<your_pass>@gitlab.test.com
- .gitconfig
[[email protected] customagent]# cat /root/.gitconfig
[credential]
helper = store
所以按照正常思路,我把两个文件挂载到所有构建容器中,这样的话,就出现了这样一个问题。很多进程并发访问这个文件,出现了这个错误。
如何解决?
jenkins提供了一个git插件,可以帮助我们运行一些git命令
// git-cloner是jenkins username/password类型的secret
withCredentials([gitUsernamePassword(credentialsId: 'git-cloner', gitToolName: 'Default')]) {
sh 'git fetch --all'
sh 'git fetch --tags -f'
}
把这一个片段贴到jenkins pipeline里,因此拉取到远程的tag列表。
接下来通过对比tag的md5和当前md5,就可以知道当前commit是否带tag。
边栏推荐
- Synchronized scope "concurrent programming"
- LiteOS_ a - SYS_ The run() function is missing a header file.
- [STM32 learning] (14) two 74HC595 controls four nixie tube displays
- Home raiding II (leetcode-213)
- [STM32 learning] (5) press the key to control the flow light (interrupt Implementation)
- TypeError: Object of type ‘int32‘ is not JSON serializable
- Dark king | analysis of zego low illumination image enhancement technology
- Arduino drive lcd1602a
- Uniapp uses PWA
- 给你的网站加一个爱发电角标
猜你喜欢

2022, enterprise unified process platform design and integration specifications refer to thubierv0.1

MySQL query database capacity size
![[STM32 learning] (6) use of serial port 1 (usart1)](/img/b1/430d3501a99e46958c066f7fd7eee9.png)
[STM32 learning] (6) use of serial port 1 (usart1)
![[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus](/img/8f/19b0eb959d2b3f896c8e99f8e673d1.png)
[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus

Tree array-
![[C language] implementation of three versions of address book small project (including source code)](/img/3b/926001332ec05378de4c35dc28ed55.png)
[C language] implementation of three versions of address book small project (including source code)
![[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus](/img/6b/b49b9e7fff62026a4818561d79fe3f.png)
[STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus

Recursion - if the function calls itself internally, then the function is a recursive function & the effect is the same as that of the loop & the push condition return should be added, otherwise stack

What if path is deleted by mistake when configuring system environment variables?
![[STM32 learning] (10) stm32f1 general timer realizes pulse counter](/img/42/1f5104f923b1868dda23bcc425fc62.png)
[STM32 learning] (10) stm32f1 general timer realizes pulse counter
随机推荐
[STM32 learning] (14) two 74HC595 controls four nixie tube displays
Spark Learning: how to choose different association forms and mechanisms?
The best time to buy and sell stocks Ⅳ (leetcode-188)
Notes on using setupproxy
Getting started with identityserver4
Simple parsing JSON strings with regular expressions
What is the cloud native mid platform business architecture?
Uniapp uses PWA
AttributeError: module ‘sipbuild. api‘ has no attribute ‘prepare_ metadata_ for_ build_ wheel‘
CRC Coding in C language
Mysql database JDBC programming
[STM32 learning] (17) STM32 realizes LCD12864 display serial implementation
2022, enterprise informatization construction based on Unified Process Platform refers to thubierv0.1
[STM32 learning] (10) stm32f1 general timer realizes pulse counter
Tag the specified commit and submit the tag
PHP debugging tool - how to install and use firephp
It's eleven again. Those jokes about nagging programmers going home for blind dates
【LeeCode】获取2个字符串的最长公共子串
When the hot tea is out of stock, what does the new tea drink rely on to continue its life?
[STM32 learning] (16) STM32 realizes LCD1602 display (74HC595 drive) - 4-bit bus