I have a pipeline set up already, but I'd like to schedule it to run once, in the future at a specific time. This way i won't have to be around to trigger it at the moment I want it to run. Is this possible?
G'day, @Cyrus Afshari
You can check our guide below on how to create schedules for your pipeline:
Create a schedule for your pipeline
However, if you need it to be on a specific day or time you'll have to use our API endpoint to create a custom schedule.
Pipeline - Create schedule endpoint
For example:
curl -u <username>:<password> -X POST --url https://api.bitbucket.org/2.0/repositories/<workspaceID>/<repoSlug>/pipelines_config/schedules/ --header 'Content-Type: application/json' --data '{"cron_pattern": "0 0/1 * 1/1 * ? *", "enabled": "true", "type": "pipeline_schedule", "target": { "ref_type": "branch", "ref_name": "<branch_name>", "type": "pipeline_ref_target", "selector": { "type": "branches", "pattern" : "testpattern" } } }'
Regards,
Syahrul
I have pipeline variables that I can set via the UI (and have default and allowed-values for) when I'm manually triggering, so how would I set those variable values via the API for a scheduled run?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am looking for this feature but it seems now 4 years since it being requested, it still hasn't been implemented: https://jira.atlassian.com/browse/BCLOUD-20328
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I got it. I will inquire about the feature request, so please watch it for any future updates. Unfortunately, there are currently no workarounds to set variables for a scheduled run unless the variables are manually input or exist in the variables list.
Regards,
Syahrul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. What do you mean by "manually input" and "exist in the variables list?" In my pipeline file, for the custom job I do have them listed as variables with default values and a list of allowed-values
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey @Cyrus Afshari
What I mean by manual input is manually triggering the pipeline and inputting the variable:
As for existing in the variables, it is to have the variables stored in the repository or your workspace level and call it in your YAML build.
Regards,
Syahrul
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.