deployinit

package
v1.0.38481-pre Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package deployinit implements scanning and patching of .circleci/config.yml to add deploy marker steps for circleci deploy init.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InferEnvironment

func InferEnvironment(jobName string) string

InferEnvironment returns an environment name from a job name, or "".

func IsDeployJob

func IsDeployJob(name string) bool

IsDeployJob returns true if jobName looks like a deploy job.

func Patch

func Patch(configPath string, input PatchInput, useOrb bool) (bool, error)

Patch modifies configPath in-place, returning true if any changes were made. It is idempotent: if the deploy step is already present it is not duplicated.

Types

type DetectResult

type DetectResult struct {
	Jobs       []JobInfo
	HasDeploys bool // config already uses circleci/deploys orb
}

DetectResult holds the jobs found in the config.

func Detect

func Detect(configPath string) (*DetectResult, error)

Detect reads configPath and returns detected deploy jobs.

type JobInfo

type JobInfo struct {
	Name        string
	Branch      string // from workflow branch filter; "" means all/unknown
	InferredEnv string // environment guessed from job name; "" if unknown
}

JobInfo describes a deploy-like job detected in the config.

type PatchInput

type PatchInput struct {
	Component string
	Jobs      []PatchJob
}

PatchInput describes what to add to the config.

type PatchJob

type PatchJob struct {
	Name        string
	Environment string
}

PatchJob describes a job to instrument.

Jump to

Keyboard shortcuts

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