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

is it possible to schedule a 1-time pipeline run?

Cyrus Afshari May 14, 2024

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?

1 answer

1 vote
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 15, 2024

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

Cyrus Afshari May 16, 2024

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?

Cyrus Afshari May 16, 2024

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 

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 16, 2024

Hi @Cyrus Afshari 

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

Cyrus Afshari May 17, 2024

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

Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2024

Hey @Cyrus Afshari 

What I mean by manual input is manually triggering the pipeline and inputting the variable:

https://support.atlassian.com/bitbucket-cloud/docs/pipeline-triggers/#Run-a-pipeline-manually-from-the-Commits-view

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

Suggest an answer

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

Atlassian Community Events