I requested:
curl -X POST \
--user ${myUserID}:${myPassword} \
--header 'Content-type: application/json' \
https://api.bitbucket.org/2.0/repositories/${myWorkSpace}/${myRepository}/pipelines_config/schedules/ \
--data '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "develop",
"selector": {
"type": "custom",
"pattern": "laravelTestOnDemand"
}
},
"cron_pattern": "0 25 9 * * 1-5 *"
}'
Then response:
{"error": {"message": "Bad request", "detail": "Response Summary: HttpResponseSummary{httpStatusCode=422, httpStatusMessage=Unprocessable Entity, bodyAsString={\"errors\":[\"expression is not valid\"]}}", "data": {"key": "trigger-service.schedule.schedule-creation-failed", "arguments": {}}}}
Please help me.
refs:
- https://ja.confluence.atlassian.com/bitbucket/scheduled-pipelines-933078702.html
- https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/pipelines_config/schedules/#post
Hi Hisashi-san,
It seems cron_pattern is not valid expression. Could you try to regenerate correct one using freeformatter.com ?
"cron_pattern": "0 25 9 * * 1-5 *"
Thanks for reply.
I tried, but same result.
・・・
--data '{
"type": "pipeline_schedule",
"enabled": true,
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "develop",
"selector": {
"type": "custom",
"pattern": "laravelTestOnDemand"
}
},
"cron_pattern": "25 9 * * 1-5"
}'
{"error": {"message": "Bad request", "detail": "Response Summary: HttpResponseSummary{httpStatusCode=422, httpStatusMessage=Unprocessable Entity, bodyAsString={\"errors\":[\"expression is not valid\"]}}", "data": {"key": "trigger-service.schedule.schedule-creation-failed", "arguments": {}}}}
~
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, I not mentioning JSON format it's about cron format.
Please generate correct cron format e.g. 25 9 * ? * * *
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
Setting is successful.
I used "0 25 9 ? * MON,TUE,WED,THU,FRI *" to cron_pattern.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Glad to help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Note: The time zone must be taken into account.
If you want to set it to 9:15 JST,
x "0 15 9 ? * MON,TUE,WED,THU,FRI *"
o "0 15 0 ? * MON,TUE,WED,THU,FRI *"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.