[英]How to clone a gitlab private repository in Gitlab CI runner using a python script?
I have a private Gitlab repository.我有一个私人 Gitlab 存储库。 And I want to clone that private repo to gitlab CI runner using a python script.
我想使用 python 脚本将该私有仓库克隆到 gitlab CI 运行器。 But the cli asks for username and password input.
但是 cli 要求输入用户名和密码。 Since, Gitlab CLI don't take manual input so, how to provide username and password for authentication.
由于 Gitlab CLI 不采用手动输入,所以如何提供用户名和密码进行身份验证。
As you can see in the documentation there are several options for authentication.正如您在文档中看到的,有多种身份验证选项。
I usually do not use password and username, because mostly you end up saving your credentials in plaintext somewhere.我通常不使用密码和用户名,因为大多数情况下您最终会将您的凭据以明文形式保存在某个地方。
My preferred way is using a private token.我的首选方式是使用私有令牌。 This descriptions explains how to create a private token on Gitlab
此描述解释了如何在 Gitlab 上创建私有令牌
For a general understanding of tokens:对于令牌的一般理解:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.