从gitlab触发npm脚本作为cron作业

gblwokeq  于 2022-12-13  发布在  Git
关注(0)|答案(1)|浏览(142)

I have a number of node scripts collected in a git repo. These scripts run against the Airtables API for various forms of table maintenance and updates. The repo is on gitlab and until now the scripts have been deployed on Heroku with a scheduler ad on. I need to trigger these scripts at intervals, such as daily and weekly intervals. Is there any way to trigger these cron jobs directly from the repo in gitlab and through some kind of service from there? I want to phase out heroku for some other simpler service to trigger these cron job scripts primarily from gitlab. Grateful for suggestions on possible solutions.

1l5u6lss

1l5u6lss1#

I have found my own solution to the problem I described earlier. In gitlab I have set up scheduled pipelines against the different cron time intervals that run the script. I have initially separated through different scheduler branches with different gitlab-ci.yml for each script in each branch. It would have been best if you could collect all the scheduler scripts in a single branch and point out which of the scripts is running at which time. I suppose this can be solved via different flags and variables when the scripts are triggered.

相关问题