Search code examples
bitbucketbitbucket-pipelinesbitbucket-apibitbucket-cloud

Best way to run bitbucket scheduled pipelines on weekdays


Bitbucket scheduled pipelines UI does not have an option for us to enter a cron expression and we can only run the pipeline hourly, daily or weekly. There is an option to create schedule via API call with cron expression in payload, however, unfortunately it does not accept a complex cron expression.

What could be the best way to achieve running the pipelines just on weekdays?

Looking for a better solution than these.

  1. Have multiple daily pipelines mon-fri.
  2. Have a daily pipeline and a check inside running logic for day.

Is there a better option?


Solution

  • Found the solution here,

    https://community.atlassian.com/t5/Bitbucket-questions/How-to-run-a-scheduled-pipeline-with-a-complex-cron-expression/qaq-p/2436171?utm_campaign=mentions_answer&utm_content=post&utm_medium=email&utm_source=atlcomm#U2437487

    NOTE:

    Cron expression 0 0 * * 1-5 does not work with bitbucket api but 0 0 * * MON-FRI does.