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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,491
Community Members
 
Community Events
184
Community Groups

How do I run bitbucket pipelines for every 5min

Edited

We have critical test pipelines that should run every5min . When I open schedule I see only Daily , Weekly, Hourly . 

1 answer

0 votes
Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 10, 2021

@mounika.nallagundla

Pipelines UI contains wide-used propositions for period. For custom schedule you can post this schedule using bitbucket api (doc https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines_config/schedules/#post ).

 

Regards, Galyna

@Halyna Berezovska  thank you very much.

Could you please provide me a piece of code example for pattern or more example information on this if possible.

Thank you

@Halyna Berezovska where exactly we can hook up this in our Repository ?

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 12, 2021

@mounika.nallagundla for example, you can create a custom pipeline that is posting a schedule. But it actually can be done only once, if you're not gonna to remove it.

But anyway, to automate this more, in bitbucket-pipelines.yml you can write something like this:


schedule-pipeline: &schedule-pipeline
step:
name: Schedule
script:
- curl -x POST -d '{"cron_pattern": "...."}' url
custom
:
schedule-pipeline:
- <<: *schedule-pipeline



 The url and request data can be found here https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines_config/schedules/#post

.

Regards, Galyna

Like mounika.nallagundla likes this

@Halyna Berezovska Thanks for the above reply. We are experimenting with it .

One more question regarding Pager Duty Integration with Bitbucket. When I see  Pager Duty integration It is hooking up with Repository not with specific pipeline run . If you provide any solution for this(pipeline test level) that will be big help for us .

Thanks.

@Halyna Berezovska I have given Workspace UUID & Repository UUID in the url .

Note: I am not posting actual values here for the privacy but tried with actual values got Resource not found.

custom: 
Every-Five-Minutes-Schedule:
- step:
name: Five Minute Schedule
script:
- curl -x POST -d '{"cron_pattern":"0 0/5 * * * ?"}' https://api.bitbucket.org/2.0/repositories/{workspace UUID}/{Repository UUID}/pipelines_config/schedules/

It’s returning with “Resource not found” error.

Let me know if you need more info.

Thanks!

Halyna Berezovska
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 14, 2021 • edited

@mounika.nallagundla we don't try it with repository id and workspace id, but with workspace name and repository name. I also tried with workspace uuid and repository uuid, it also works.

SO there could be two issues in your request:

- something is wrong with authorization scope. perhaps you did not give required right for your app password that you use on authentication

- misstyp in url. my urll looks like:

https://api.bitbucket.org/2.0/repositories/{WORKSPACE_UUID}/{REPO_UUID}/pipelines_config/schedules/

or

https://api.bitbucket.org/2.0/repositories/workspace/repo/pipelines_config/schedules/

Check also the url  contains proper workspace uuid and repository uuid. You can find them , for example, in OpenID COnnect tab of repository - this tab gives such info.

However, it is easier and more handy to use names.

 

 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events