如何通过在Gitlab CICD中设置环境变量(迄今为止的项目和列表),从CSV文件中获得两个日期之间的记录?
我的git存储库中有多个项目,因此我已经在Python中开发了一个代码,可以通过该代码获得每个开发人员所做的所有提交的信息,以及所有记录,CSV文件使用标头列表生成,并提交给,gitlab_url,项目,分支,状态,用户名,门票,主题。
现在,我想通过在Gitlab CICD中设置环境变量(迄今为止的项目和列表)来为特定日期和特定项目生成CSV文件。
我的意思是,从CICD中的日期和项目ID开始并运行管道,对于相同的CSV报告,用户将归类为迄今为止。
如果用户从日期和项目ID和运行管道运行,则默认情况下应生成所有提交的CSV。
I am having multiple project in my git repository so I have develop a code in python through which I can get info of all the commits made by each and every developer and for all the records a csv file get generated with a header list Date,Submitted,Gitlab_url,Project,Branch,Status,Username,Ticket,Subject.
Now I want to generate a csv file for the particular dates and for a particular project by setting an environment variable (To date, From Date and List of project) in gitlab CICD.
I mean user will entre To Date , From Date and Project id in CICD and run the pipeline and for the same csv report should get generated.
If user is not inserting To Date , From Date and Project id and running the pipeline then by default csv for all the commits should be generate.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这感觉不像CI应该做的事情 - 它应该用于测试项目构建,运行单元测试或集成以及类似的内容。
这感觉就像可以手工执行的管理任务。
话虽这么说,您可以通过在GitLab中创建时间表来实现所需的功能,因此您可以定义变量及其值。使用这些变量作为Python脚本的输入来输出CSV,然后您只需单击即可运行时间表并在需要时更改值。
This doesn’t feel like something CI should be doing - it should be used to test projects building, running unit tests or integrations and stuff like that.
This feels like an admin task that could be performed by hand.
That being said, you can achieve the functionality you want by creating a schedule within gitlab, a schedule allows you to define variables and their values. Use these variables as input for your python script to output the csv and then you can just click to run the schedule and change the values when you need to.