build

package
v0.73.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2023 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuildWorkflow_Override

func NewBuildWorkflow_Override(b BuildWorkflow, project projen.Project, options *BuildWorkflowOptions)

Experimental.

Types

type AddPostBuildJobCommandsOptions

type AddPostBuildJobCommandsOptions struct {
	// Check out the repository at the pull request branch before commands are run.
	// Default: false.
	//
	// Experimental.
	CheckoutRepo *bool `field:"optional" json:"checkoutRepo" yaml:"checkoutRepo"`
	// Install project dependencies before running commands. `checkoutRepo` must also be set to true.
	//
	// Currently only supported for `NodeProject`.
	// Default: false.
	//
	// Experimental.
	InstallDeps *bool `field:"optional" json:"installDeps" yaml:"installDeps"`
	// Github Runner selection labels.
	// Default: ["ubuntu-latest"].
	//
	// Experimental.
	RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
	// Github Runner Group selection options.
	// Experimental.
	RunsOnGroup *projen.GroupRunnerOptions `field:"optional" json:"runsOnGroup" yaml:"runsOnGroup"`
	// Tools that should be installed before the commands are run.
	// Experimental.
	Tools *workflows.Tools `field:"optional" json:"tools" yaml:"tools"`
}

Options for `BuildWorkflow.addPostBuildJobCommands`. Experimental.

type AddPostBuildJobTaskOptions

type AddPostBuildJobTaskOptions struct {
	// Github Runner selection labels.
	// Default: ["ubuntu-latest"].
	//
	// Experimental.
	RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
	// Github Runner Group selection options.
	// Experimental.
	RunsOnGroup *projen.GroupRunnerOptions `field:"optional" json:"runsOnGroup" yaml:"runsOnGroup"`
	// Tools that should be installed before the task is run.
	// Experimental.
	Tools *workflows.Tools `field:"optional" json:"tools" yaml:"tools"`
}

Options for `BuildWorkflow.addPostBuildJobTask`. Experimental.

type BuildWorkflow

type BuildWorkflow interface {
	projen.Component
	// Returns a list of job IDs that are part of the build.
	// Experimental.
	BuildJobIds() *[]*string
	// Experimental.
	Project() projen.Project
	// Adds another job to the build workflow which is executed after the build job succeeded.
	//
	// Jobs are executed _only_ if the build did NOT self mutate. If the build
	// self-mutate, the branch will either be updated or the build will fail (in
	// forks), so there is no point in executing the post-build job.
	// Experimental.
	AddPostBuildJob(id *string, job *workflows.Job)
	// Run a sequence of commands as a job within the build workflow which is executed after the build job succeeded.
	//
	// Jobs are executed _only_ if the build did NOT self mutate. If the build
	// self-mutate, the branch will either be updated or the build will fail (in
	// forks), so there is no point in executing the post-build job.
	// Experimental.
	AddPostBuildJobCommands(id *string, commands *[]*string, options *AddPostBuildJobCommandsOptions)
	// Run a task as a job within the build workflow which is executed after the build job succeeded.
	//
	// The job will have access to build artifacts and will install project
	// dependencies in order to be able to run any commands used in the tasks.
	//
	// Jobs are executed _only_ if the build did NOT self mutate. If the build
	// self-mutate, the branch will either be updated or the build will fail (in
	// forks), so there is no point in executing the post-build job.
	// Experimental.
	AddPostBuildJobTask(task projen.Task, options *AddPostBuildJobTaskOptions)
	// Adds steps that are executed after the build.
	// Experimental.
	AddPostBuildSteps(steps ...*workflows.JobStep)
	// Called after synthesis.
	//
	// Order is *not* guaranteed.
	// Experimental.
	PostSynthesize()
	// Called before synthesis.
	// Experimental.
	PreSynthesize()
	// Synthesizes files to the project output directory.
	// Experimental.
	Synthesize()
}

Experimental.

func NewBuildWorkflow

func NewBuildWorkflow(project projen.Project, options *BuildWorkflowOptions) BuildWorkflow

Experimental.

type BuildWorkflowOptions

type BuildWorkflowOptions struct {
	// A name of a directory that includes build artifacts.
	// Experimental.
	ArtifactsDirectory *string `field:"required" json:"artifactsDirectory" yaml:"artifactsDirectory"`
	// The task to execute in order to build the project.
	// Experimental.
	BuildTask projen.Task `field:"required" json:"buildTask" yaml:"buildTask"`
	// The container image to use for builds.
	// Default: - the default workflow container.
	//
	// Experimental.
	ContainerImage *string `field:"optional" json:"containerImage" yaml:"containerImage"`
	// Build environment variables.
	// Default: {}.
	//
	// Experimental.
	Env *map[string]*string `field:"optional" json:"env" yaml:"env"`
	// Git identity to use for the workflow.
	// Default: - default identity.
	//
	// Experimental.
	GitIdentity *github.GitIdentity `field:"optional" json:"gitIdentity" yaml:"gitIdentity"`
	// Automatically update files modified during builds to pull-request branches.
	//
	// This means that any files synthesized by projen or e.g. test snapshots will
	// always be up-to-date before a PR is merged.
	//
	// Implies that PR builds do not have anti-tamper checks.
	//
	// This is enabled by default only if `githubTokenSecret` is set. Otherwise it
	// is disabled, which implies that file changes that happen during build will
	// not be pushed back to the branch.
	// Default: true.
	//
	// Experimental.
	MutableBuild *bool `field:"optional" json:"mutableBuild" yaml:"mutableBuild"`
	// Name of the buildfile (e.g. "build" becomes "build.yml").
	// Default: "build".
	//
	// Experimental.
	Name *string `field:"optional" json:"name" yaml:"name"`
	// Permissions granted to the build job To limit job permissions for `contents`, the desired permissions have to be explicitly set, e.g.: `{ contents: JobPermission.NONE }`.
	// Default: `{ contents: JobPermission.WRITE }`
	//
	// Experimental.
	Permissions *workflows.JobPermissions `field:"optional" json:"permissions" yaml:"permissions"`
	// Steps to execute after build.
	// Default: [].
	//
	// Experimental.
	PostBuildSteps *[]*workflows.JobStep `field:"optional" json:"postBuildSteps" yaml:"postBuildSteps"`
	// Steps to execute before the build.
	// Default: [].
	//
	// Experimental.
	PreBuildSteps *[]*workflows.JobStep `field:"optional" json:"preBuildSteps" yaml:"preBuildSteps"`
	// Github Runner selection labels.
	// Default: ["ubuntu-latest"].
	//
	// Experimental.
	RunsOn *[]*string `field:"optional" json:"runsOn" yaml:"runsOn"`
	// Github Runner Group selection options.
	// Experimental.
	RunsOnGroup *projen.GroupRunnerOptions `field:"optional" json:"runsOnGroup" yaml:"runsOnGroup"`
	// Build workflow triggers.
	// Default: "{ pullRequest: {}, workflowDispatch: {} }".
	//
	// Experimental.
	WorkflowTriggers *workflows.Triggers `field:"optional" json:"workflowTriggers" yaml:"workflowTriggers"`
}

Experimental.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL