Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Cron expression in bitbucket-pipeline.yml?

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?

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 21, 2023

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.:

Screenshot 2023-02-21 at 15.13.30.png

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

This will do. 
Thank you very much.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events