You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I want to schedule a pipeline using a cron expression but i don't know how to add that value to my bitbucket-pipeline.yml in order to see it when using the schedule function in bitbucket.
How do i add it in the bitbucket-pipeline file?
Hi Bruno!
Schedules are not configured in the bitbucket-pipeline.yml file. If you open the Pipelines page of the repo, you will see an option Schedules at the top right corner.:
You can select that option in order to create a schedule.
Another option is to use our API to create a schedule and you can pass the cron expression as an argument:
An example API call is the following:
curl -X POST -u Bitbucket_Username:App_Password 'https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/pipelines_config/schedules/' -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{
"type": "pipeline_schedule",
"target": {
"ref_type": "branch",
"type": "pipeline_ref_target",
"ref_name": "master",
"selector": {
"type": "custom",
"pattern": "master"
}
},
"cron_pattern": "0 0 0 1 * ? *"
}'
Please feel free to let me know if you have any questions.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.