当前位置:网站首页>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。
边栏推荐
- Calculate CPU utilization [Prometheus]
- JMeter setting default startup Chinese
- [STM32 learning] (18) STM32 realizes LCD12864 display - parallel implementation of 8-bit bus
- Segment tree--
- MySQL query database capacity size
- [STM32 learning] (22) STM32 realizes 360 degree rotary encoder
- [STM32 learning] (15) STM32 realizes DHT11 temperature and humidity acquisition and display
- unity中物体z旋转同步面板上的数值
- TypeError: Object of type ‘int32‘ is not JSON serializable
- 缓冲区的概念真的理解么?带你揭开缓冲区的面纱~
猜你喜欢

The most complete solution for distributed transactions

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

The concept and representation of a tree

Raspberry Pie: serial port login does not display print information

Add SSH key to bitbucket

This article takes you to understand the dynamic memory allocation of C language

error: field ‘XXX’ declared as a function
![[STM32 learning] (22) STM32 realizes 360 degree rotary encoder](/img/8e/fb036296ec3aff5e60acee5018943c.png)
[STM32 learning] (22) STM32 realizes 360 degree rotary encoder
![[STM32 learning] (13) STM32 realizes ultrasonic ranging (hc-sr04)](/img/6e/b7cf7a8e3296e29d61a0626e3793ea.png)
[STM32 learning] (13) STM32 realizes ultrasonic ranging (hc-sr04)

Spark Learning: using RDD API to implement inverted index
随机推荐
Home raiding II (leetcode-213)
Hucang integrated e-commerce project (I): introduction to the project background and structure
Mysql8.0 authorized remote login
Reading makes people improve my list
Set scrolling for the box
757. Set the intersection size to at least 2: greedy application question
Use of jstack "JVM common commands"
Where is the bitbucket clone address
Arduino drive Lora module node
Dynamic planning: robbing families and houses
Openstack network neutron knowledge point "openstack"
Redis configuration serialization
How to solve command 'xxx GCC' not found, but can be installed with:??
Getting started with identityserver4
MySQL status view qps/tps/ cache hit rate view
Spark Learning: build SQL to meet the specified optimization rules
In the envy of LETV, there is a "meaning crisis" of contemporary workers
Uniapp calendar component
Spark Learning: using RDD API to implement inverted index
What happens from the input URL to the page load