简体   繁体   English

如何通过在 gitlab CICD 中设置环境变量(截止日期、起始日期和项目列表)从 CSV 文件中获取两个日期之间的记录?

[英]How can I get records between two dates from CSV file by setting an environment variable (To date, From Date and List of project) in gitlab CICD?

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.我在我的 git 存储库中有多个项目,所以我在 python 中开发了一个代码,通过它我可以获取每个开发人员所做的所有提交的信息,并为所有记录生成一个带有标题列表日期的 csv 文件,提交,Gitlab_url,项目,分支,状态,用户名,工单,主题。

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.现在我想通过在 gitlab CICD 中设置环境变量(To date、From Date 和 List of project)为特定日期和特定项目生成一个 csv 文件。

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.我的意思是用户将在 CICD 中输入 To Date 、 From Date 和 Project id 并运行管道,并且应该生成相同的 csv 报告。

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.如果用户没有插入 To Date 、 From Date 和 Project id 并运行管道,则默认情况下应生成所有提交的 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.这感觉不应该是 CI 应该做的事情——它应该用于测试项目构建、运行单元测试或集成以及类似的东西。

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.话虽如此,您可以通过在 gitlab 中创建计划来实现您想要的功能,计划允许您定义变量及其值。 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.使用这些变量作为 Python 脚本的输入以输出 csv,然后您只需单击即可运行计划并在需要时更改值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从 csv 获取日期列表(作为字符串)并仅返回开始日期和结束日期之间的日期/数据? - How can I take list of Dates from csv (as strings) and return only the dates/data between a start date and end date? 如何检查日期是否位于来自循环的两个日期之间 - How can I check if the date lies between two dates coming from loop 如何从 csv 文件中获取 2 个日期之间的差异? - How do I get the difference between 2 dates from a csv file? 如何从带有日期和其他单词的列中获取日期? - How can I get dates from a column with date and other words? 我如何找到日期是否介于两个日期之间 - How can i find if the date lies between two dates 如何从SQL和Pandas中的日期范围中获取日期 - How to get in-between dates from a date range in SQL and Pandas Python。 如何从日期列表中获取开始和结束日期 - Python. How to get start and end date from list of dates 如何从csv中获取具有开始和结束时间的两个日期范围之间的重叠? - How to get overlap between two date ranges that have a start and end time from a csv? 使用 python 从 csv 获取指定开始和结束日期之间的日期范围 - Get range of dates between specified start and end date from csv using python 从列表中获取两个日期之间的元素 - Get Elements between two dates from a list
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM