有没有办法使用 python-gitlab 按上周的名称获取特定工作?
我想要做什么:
要从 gitlab 工件创建报告,我想查看具有特定名称(在我的示例中为 lighthouse)的所有最近作业(过去一周左右)并提取所有工件。
问题:
当我知道作业 ID 时,我可以使用 python-gitlab 包从特定作业中提取工件。到目前为止,我没能做到的是扫描我的项目,查找上周名为“lighthouse”的所有作业,并以这种方式获取所有必要的作业。
问题:
有没有办法使用 gitlab-python 包解决我的问题? 我也尝试过使用curl,但据我所知,我的问题也无法用curl 解决。 有什么建议吗? :)
What I want to do:
To create reports from gitlab artifacts, I want to look at all recent jobs (the past week or so) with a certain name (lighthouse in my example) and extract all artifacts.
The problem:
I got to a point where I can extract artifacts from a specific job using the python-gitlab package, when I know the jobs ID. What I didn't manage to do so far is scan my project for all jobs in the last week with the name "lighthouse" and get all the necessary jobs this way.
The question:
Is there a way to solve my problem using the gitlab-python package?
I've also tried using curl as well, but as far as I can see my problem isn't solvable with curl either.
Any tips? :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可以使用 项目管道列表 API 和列出管道作业 API。
使用 python-gitlab 库,它可能看起来像这样:
假设我想从过去 30 个创建的管道中的项目
spyoungtech/testproject
中获取所有名为test
的作业天。对于你的情况,你可能会这样做:
This is possible using the project pipelines list API and list pipeline jobs API.
With the python-gitlab library, it might look something like this:
Suppose I wanted to get all jobs named
test
from the projectspyoungtech/testproject
from pipelines created in the last 30 days.In your case, you might do: