buildkite.Pipeline.Schedule
Explore with Pulumi AI
A pipeline schedule is a schedule that triggers a pipeline to run at a specific time.
You can find more information in the documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as buildkite from "@pulumiverse/buildkite";
// create a pipeline
const pipeline = new buildkite.pipeline.Pipeline("pipeline", {repository: "https://github.com/..."});
// schedule a build at midnight every day
const nightly = new buildkite.pipeline.Schedule("nightly", {
pipelineId: buildkite_pipeline.repo.id,
label: "Nightly build",
cronline: "@midnight",
branch: buildkite_pipeline.repo.default_branch,
});
import pulumi
import pulumiverse_buildkite as buildkite
# create a pipeline
pipeline = buildkite.pipeline.Pipeline("pipeline", repository="https://github.com/...")
# schedule a build at midnight every day
nightly = buildkite.pipeline.Schedule("nightly",
pipeline_id=buildkite_pipeline["repo"]["id"],
label="Nightly build",
cronline="@midnight",
branch=buildkite_pipeline["repo"]["default_branch"])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-buildkite/sdk/v3/go/buildkite/Pipeline"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// create a pipeline
_, err := Pipeline.NewPipeline(ctx, "pipeline", &Pipeline.PipelineArgs{
Repository: pulumi.String("https://github.com/..."),
})
if err != nil {
return err
}
// schedule a build at midnight every day
_, err = Pipeline.NewSchedule(ctx, "nightly", &Pipeline.ScheduleArgs{
PipelineId: pulumi.Any(buildkite_pipeline.Repo.Id),
Label: pulumi.String("Nightly build"),
Cronline: pulumi.String("@midnight"),
Branch: pulumi.Any(buildkite_pipeline.Repo.Default_branch),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Buildkite = Pulumiverse.Buildkite;
return await Deployment.RunAsync(() =>
{
// create a pipeline
var pipeline = new Buildkite.Pipeline.Pipeline("pipeline", new()
{
Repository = "https://github.com/...",
});
// schedule a build at midnight every day
var nightly = new Buildkite.Pipeline.Schedule("nightly", new()
{
PipelineId = buildkite_pipeline.Repo.Id,
Label = "Nightly build",
Cronline = "@midnight",
Branch = buildkite_pipeline.Repo.Default_branch,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.buildkite.Pipeline.Pipeline;
import com.pulumi.buildkite.Pipeline.PipelineArgs;
import com.pulumi.buildkite.Pipeline.Schedule;
import com.pulumi.buildkite.Pipeline.ScheduleArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var pipeline = new Pipeline("pipeline", PipelineArgs.builder()
.repository("https://github.com/...")
.build());
var nightly = new Schedule("nightly", ScheduleArgs.builder()
.pipelineId(buildkite_pipeline.repo().id())
.label("Nightly build")
.cronline("@midnight")
.branch(buildkite_pipeline.repo().default_branch())
.build());
}
}
resources:
# create a pipeline
pipeline:
type: buildkite:Pipeline:Pipeline
properties:
repository: https://github.com/...
# schedule a build at midnight every day
nightly:
type: buildkite:Pipeline:Schedule
properties:
pipelineId: ${buildkite_pipeline.repo.id}
label: Nightly build
cronline: '@midnight'
branch: ${buildkite_pipeline.repo.default_branch}
Create Schedule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Schedule(name: string, args: ScheduleArgs, opts?: CustomResourceOptions);
@overload
def Schedule(resource_name: str,
args: ScheduleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Schedule(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
cronline: Optional[str] = None,
label: Optional[str] = None,
pipeline_id: Optional[str] = None,
commit: Optional[str] = None,
enabled: Optional[bool] = None,
env: Optional[Mapping[str, str]] = None,
message: Optional[str] = None)
func NewSchedule(ctx *Context, name string, args ScheduleArgs, opts ...ResourceOption) (*Schedule, error)
public Schedule(string name, ScheduleArgs args, CustomResourceOptions? opts = null)
public Schedule(String name, ScheduleArgs args)
public Schedule(String name, ScheduleArgs args, CustomResourceOptions options)
type: buildkite:Pipeline:Schedule
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ScheduleArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var scheduleResource = new Buildkite.Pipeline.Schedule("scheduleResource", new()
{
Branch = "string",
Cronline = "string",
Label = "string",
PipelineId = "string",
Commit = "string",
Enabled = false,
Env =
{
{ "string", "string" },
},
Message = "string",
});
example, err := Pipeline.NewSchedule(ctx, "scheduleResource", &Pipeline.ScheduleArgs{
Branch: pulumi.String("string"),
Cronline: pulumi.String("string"),
Label: pulumi.String("string"),
PipelineId: pulumi.String("string"),
Commit: pulumi.String("string"),
Enabled: pulumi.Bool(false),
Env: pulumi.StringMap{
"string": pulumi.String("string"),
},
Message: pulumi.String("string"),
})
var scheduleResource = new Schedule("scheduleResource", ScheduleArgs.builder()
.branch("string")
.cronline("string")
.label("string")
.pipelineId("string")
.commit("string")
.enabled(false)
.env(Map.of("string", "string"))
.message("string")
.build());
schedule_resource = buildkite.pipeline.Schedule("scheduleResource",
branch="string",
cronline="string",
label="string",
pipeline_id="string",
commit="string",
enabled=False,
env={
"string": "string",
},
message="string")
const scheduleResource = new buildkite.pipeline.Schedule("scheduleResource", {
branch: "string",
cronline: "string",
label: "string",
pipelineId: "string",
commit: "string",
enabled: false,
env: {
string: "string",
},
message: "string",
});
type: buildkite:Pipeline:Schedule
properties:
branch: string
commit: string
cronline: string
enabled: false
env:
string: string
label: string
message: string
pipelineId: string
Schedule Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Schedule resource accepts the following input properties:
- Branch string
- The branch that the schedule should run on.
- Cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- Label string
- A label to describe the schedule.
- Pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- Commit string
- The commit that the schedule should run on.
- Enabled bool
- Whether the schedule is enabled or not.
- Env Dictionary<string, string>
- The environment variables that scheduled builds should use.
- Message string
- The message the builds show for builds created by this schedule.
- Branch string
- The branch that the schedule should run on.
- Cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- Label string
- A label to describe the schedule.
- Pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- Commit string
- The commit that the schedule should run on.
- Enabled bool
- Whether the schedule is enabled or not.
- Env map[string]string
- The environment variables that scheduled builds should use.
- Message string
- The message the builds show for builds created by this schedule.
- branch String
- The branch that the schedule should run on.
- cronline String
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- label String
- A label to describe the schedule.
- pipeline
Id String - The GraphQL ID of the pipeline that this schedule belongs to.
- commit String
- The commit that the schedule should run on.
- enabled Boolean
- Whether the schedule is enabled or not.
- env Map<String,String>
- The environment variables that scheduled builds should use.
- message String
- The message the builds show for builds created by this schedule.
- branch string
- The branch that the schedule should run on.
- cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- label string
- A label to describe the schedule.
- pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- commit string
- The commit that the schedule should run on.
- enabled boolean
- Whether the schedule is enabled or not.
- env {[key: string]: string}
- The environment variables that scheduled builds should use.
- message string
- The message the builds show for builds created by this schedule.
- branch str
- The branch that the schedule should run on.
- cronline str
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- label str
- A label to describe the schedule.
- pipeline_
id str - The GraphQL ID of the pipeline that this schedule belongs to.
- commit str
- The commit that the schedule should run on.
- enabled bool
- Whether the schedule is enabled or not.
- env Mapping[str, str]
- The environment variables that scheduled builds should use.
- message str
- The message the builds show for builds created by this schedule.
- branch String
- The branch that the schedule should run on.
- cronline String
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- label String
- A label to describe the schedule.
- pipeline
Id String - The GraphQL ID of the pipeline that this schedule belongs to.
- commit String
- The commit that the schedule should run on.
- enabled Boolean
- Whether the schedule is enabled or not.
- env Map<String>
- The environment variables that scheduled builds should use.
- message String
- The message the builds show for builds created by this schedule.
Outputs
All input properties are implicitly available as output properties. Additionally, the Schedule resource produces the following output properties:
Look up Existing Schedule Resource
Get an existing Schedule resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ScheduleState, opts?: CustomResourceOptions): Schedule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
branch: Optional[str] = None,
commit: Optional[str] = None,
cronline: Optional[str] = None,
enabled: Optional[bool] = None,
env: Optional[Mapping[str, str]] = None,
label: Optional[str] = None,
message: Optional[str] = None,
pipeline_id: Optional[str] = None,
uuid: Optional[str] = None) -> Schedule
func GetSchedule(ctx *Context, name string, id IDInput, state *ScheduleState, opts ...ResourceOption) (*Schedule, error)
public static Schedule Get(string name, Input<string> id, ScheduleState? state, CustomResourceOptions? opts = null)
public static Schedule get(String name, Output<String> id, ScheduleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Branch string
- The branch that the schedule should run on.
- Commit string
- The commit that the schedule should run on.
- Cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- Enabled bool
- Whether the schedule is enabled or not.
- Env Dictionary<string, string>
- The environment variables that scheduled builds should use.
- Label string
- A label to describe the schedule.
- Message string
- The message the builds show for builds created by this schedule.
- Pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- Uuid string
- The UUID of the schedule.
- Branch string
- The branch that the schedule should run on.
- Commit string
- The commit that the schedule should run on.
- Cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- Enabled bool
- Whether the schedule is enabled or not.
- Env map[string]string
- The environment variables that scheduled builds should use.
- Label string
- A label to describe the schedule.
- Message string
- The message the builds show for builds created by this schedule.
- Pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- Uuid string
- The UUID of the schedule.
- branch String
- The branch that the schedule should run on.
- commit String
- The commit that the schedule should run on.
- cronline String
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- enabled Boolean
- Whether the schedule is enabled or not.
- env Map<String,String>
- The environment variables that scheduled builds should use.
- label String
- A label to describe the schedule.
- message String
- The message the builds show for builds created by this schedule.
- pipeline
Id String - The GraphQL ID of the pipeline that this schedule belongs to.
- uuid String
- The UUID of the schedule.
- branch string
- The branch that the schedule should run on.
- commit string
- The commit that the schedule should run on.
- cronline string
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- enabled boolean
- Whether the schedule is enabled or not.
- env {[key: string]: string}
- The environment variables that scheduled builds should use.
- label string
- A label to describe the schedule.
- message string
- The message the builds show for builds created by this schedule.
- pipeline
Id string - The GraphQL ID of the pipeline that this schedule belongs to.
- uuid string
- The UUID of the schedule.
- branch str
- The branch that the schedule should run on.
- commit str
- The commit that the schedule should run on.
- cronline str
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- enabled bool
- Whether the schedule is enabled or not.
- env Mapping[str, str]
- The environment variables that scheduled builds should use.
- label str
- A label to describe the schedule.
- message str
- The message the builds show for builds created by this schedule.
- pipeline_
id str - The GraphQL ID of the pipeline that this schedule belongs to.
- uuid str
- The UUID of the schedule.
- branch String
- The branch that the schedule should run on.
- commit String
- The commit that the schedule should run on.
- cronline String
- The cronline that describes when the schedule should run. Seehere for supported syntax.
- enabled Boolean
- Whether the schedule is enabled or not.
- env Map<String>
- The environment variables that scheduled builds should use.
- label String
- A label to describe the schedule.
- message String
- The message the builds show for builds created by this schedule.
- pipeline
Id String - The GraphQL ID of the pipeline that this schedule belongs to.
- uuid String
- The UUID of the schedule.
Import
import a pipeline schedule resource using the schedules GraphQL ID
you can use this query to find the schedule:
query getPipelineScheduleId {
organization(slug: “ORGANIZATION_SLUG”) {
pipelines(first: 5, search: "PIPELINE_SEARCH_TERM") {
edges{
node{
name
schedules{
edges{
node{
id
}
}
}
}
}
}
}
}
$ pulumi import buildkite:Pipeline/schedule:Schedule test UGlwZWxpgm5Tf2hhZHVsZ35tLWRk4DdmN7c4LTA5M2ItNDM9YS0gMWE0LTAwZDUgYTAxYvRf49==
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- buildkite pulumiverse/pulumi-buildkite
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
buildkite
Terraform Provider.