I want to run a heavy test only once per day in Gitlab-ci. Is it possible schedule a job? Or is it possible to set it to manual and trigger it using the API?
It's possible to schedule a pipeline since GitLab 9.1, see: https://docs.gitlab.com/ce/user/project/pipelines/schedules.html
Currently (i.e. with version 9.2) it can be configured as follows:
It's a patch up job, but you could use triggers with a if statement :
test_app:
stage: test
script:
- if [ -n "${DO_TESTS}" ]; then make test; fi
And define the variable in the cron that make the call :
curl --request POST \
--form token=TOKEN \
--form ref=master \
--form "variables[DO_TESTS]=true" \
https://gitlab.example.com/api/v3/projects/9/trigger/builds
See the doc : https://docs.gitlab.com/ce/ci/triggers/README.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With