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?
Schedule or trigger jobs in gitlab-ci
11.5k views Asked by Jesse van Bekkum At
3
There are 3 answers
2
On
This is possible, and will be improved in GitLab 11.6 (Dec. 22nd)
See gitlab-org/gitlab-ce issue 20422:
Currently all variables are shown in UI: http://docs.gitlab.com/ce/ci/triggers/README.html#pass-build-variables-to-a-trigger
This is sometimes problematic, e.g. when you pass individual secrets to the build, which could not be placed in a protected variable and should not be visible to all team members.
It can also be problematic even for some non-protected variables if they are unintentionally passed around in a screenshot/screen sharing.
Proposal
- Variable names will still be visible by default
- Variables values will be censored by default with asterix
*******
- Variable values are toggle-able with a button
- The button is only available to maintainers
2
On
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:
- Navigate to your project's Pipelines ➔ Schedules and click the New Schedule button.
- Fill in the form
- Hit Save pipeline schedule for the changes to take effect.
It's a patch up job, but you could use triggers with a if statement :
And define the variable in the cron that make the call :
See the doc : https://docs.gitlab.com/ce/ci/triggers/README.html