Reputation: 2063
Really do not understand how I can setup daily scheduler in gitlab . I have simple application and I need automatically build it every day at 8.00 morning. I tried with Following https://gitlab.com/help/ci/triggers/README.md , but i do not understand how can I run this crone job?
30 0 * * * curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v3/projects/9/trigger/builds
This is also unacceptable http://cloudlady911.com/index.php/2016/11/02/how-to-schedule-a-job-in-gitlab-8-13/
because I must manually run it from pipeline.
Any solutions?
Upvotes: 3
Views: 6429
Reputation: 3285
Now you can setup schedules in gitlab natively to run any pipeline each day.
Upvotes: 6
Reputation: 3092
Whether you craft a script or just run cURL directly, you can trigger jobs in conjunction with cron. The example below triggers a job on the master branch of project with ID 9 every night at 00:30:
30 0 * * * curl --request POST --form token=TOKEN --form ref=master https://gitlab.example.com/api/v3/projects/9/trigger/builds
This triggers script in your .gitlab-ci.yml
. The assumption is you have ur deployment script prepared in this file. So it will execute stages step by step and if ur step is deployment, it will deploy your application.
Upvotes: 3