Running job of pipeline in scheduled build

I have a pipeline, which is just a set of jobs. There’s no sequence. There’s just integration-test, unittest and benchmark. How can I schedule a nightly job to just run the benchmark?

I have the scheduled job running nightly, however it’s running all of the jobs in the pipeline, as I haven’t found a way to restrict which jobs to run. Is this possible?

OK, after reading:
https://docs.gitlab.com/ce/user/project/pipelines/schedules.html

It seems that you can at least specify coarsely that some jobs should only run when scheduled with:

only:
   - schedules

So, I can specify that benchmarking should only run on schedules but it’s not great because I might have different schedules for different things. Is there a way to specify the schedule name maybe?

Like:

only:
   - schedules: [nightly-benchmark]
1 Like

You can use variables-expressions. https://docs.gitlab.com/ee/ci/variables/#variables-expressions

Please add an variable (as an identifier) to each schedule and

job:
  only:
    variables:
      - $PIPELINE_SCHEDULE_IDENTIFIER == "schedule 1"
1 Like

That’s a recent feature! Awesome, thanks.