projects

package
v2.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2022 License: Apache-2.0 Imports: 20 Imported by: 32

Documentation

Index

Constants

View Source
const (
	PersistenceSettingsTypeDatabase          = PersistenceSettingsType("Database")
	PersistenceSettingsTypeVersionControlled = PersistenceSettingsType("VersionControlled")
)
View Source
const (
	GitRefTypeBranch = GitRefType("GitBranch")
	GitRefTypeTag    = GitRefType("GitTag")
	GitRefTypeCommit = GitRefType("GitCommit")
)

Variables

This section is empty.

Functions

func IsNil

func IsNil(i interface{}) bool

func NewProjects

func NewProjects() *resources.Resources[*Project]

Types

type AutoDeployReleaseOverride

type AutoDeployReleaseOverride struct {
	EnvironmentID string `json:"EnvironmentId,omitempty"`
	ReleaseID     string `json:"ReleaseId,omitempty"`
	TenantID      string `json:"TenantId,omitempty"`
}

AutoDeployReleaseOverride represents an auto-deploy release override.

type ConversionState added in v2.10.0

type ConversionState struct {
	VariablesAreInGit bool
}

func NewConversionState added in v2.10.0

func NewConversionState(variablesAreInGit bool) *ConversionState

type ConvertToVcs

type ConvertToVcs struct {
	CommitMessage          string
	VersionControlSettings GitPersistenceSettings
}

func NewConvertToVcs

func NewConvertToVcs(commitMessage string, gitPersistenceSettings GitPersistenceSettings) *ConvertToVcs

type ConvertToVcsResponse

type ConvertToVcsResponse struct {
	Messages []string
}

type DashboardItem added in v2.4.0

type DashboardItem struct {
	ProjectID               string `json:"ProjectId"`
	DeploymentEnvironmentID string `json:"DeploymentEnvironmentId"`
	ReleaseID               string `json:"ReleaseId"`
	DeploymentID            string `json:"DeploymentId"`
	TaskID                  string `json:"TaskId"`
}

type DatabasePersistenceSettings

type DatabasePersistenceSettings interface {
	PersistenceSettings
}

DatabasePersistenceSettings represents database persistence settings associated with a project.

func NewDatabasePersistenceSettings

func NewDatabasePersistenceSettings() DatabasePersistenceSettings

NewDatabasePersistenceSettings creates an instance of database persistence settings.

type ExtensionSettingsValues

type ExtensionSettingsValues struct {
	ExtensionID string      `json:"ExtensionId,omitempty"`
	Values      interface{} `json:"Values,omitempty"`
}

type GitPersistenceSettings

type GitPersistenceSettings interface {
	BasePath() string
	SetBasePath(basePath string)

	DefaultBranch() string
	SetDefaultBranch(defaultBranch string)

	ProtectedBranchNamePatterns() []string
	SetProtectedBranchNamePatterns(protectedBranchNamePatterns []string)

	URL() *url.URL
	SetURL(url *url.URL)

	Credential() credentials.GitCredential
	SetCredential(credential credentials.GitCredential)

	PersistenceSettings
}

func NewGitPersistenceSettings

func NewGitPersistenceSettings(
	basePath string,
	credentials credentials.GitCredential,
	defaultBranch string,
	protectedBranchNamePatterns []string,
	url *url.URL) GitPersistenceSettings

NewGitPersistenceSettings creates an instance of persistence settings.

type GitRefType added in v2.3.2

type GitRefType string

func (GitRefType) Description added in v2.3.2

func (refType GitRefType) Description() string

Description returns a human-readable string representing the ref type; Not suitable for programmatic use

type GitReference added in v2.3.2

type GitReference struct {
	Type          GitRefType        `json:"-"`                       // added by the client library in case you need to disambiguate branches/tags in a single collection
	Name          string            `json:"Name,omitempty"`          // display name of the git item e.g. "main"
	CanonicalName string            `json:"CanonicalName,omitempty"` // underlying git reference e.g. "/refs/heads/main"
	Links         map[string]string `json:"Links,omitempty"`
}

GitReference represents the data returned from the Octopus Server relating to a git branch or tag in a version controlled project. Both branches and tags share the same resource format

func NewGitBranchReference added in v2.3.2

func NewGitBranchReference(name string, canonicalName string) *GitReference

func NewGitTagReference added in v2.3.2

func NewGitTagReference(name string, canonicalName string) *GitReference

type PersistenceSettings added in v2.12.0

type PersistenceSettings interface {
	Type() PersistenceSettingsType
}

PersistenceSettings defines the interface for persistence settings.

type PersistenceSettingsType added in v2.10.0

type PersistenceSettingsType string

type Progression added in v2.4.0

type Progression struct {
	LifecycleEnvironments map[string][]resources.ReferenceDataItem `json:"LifecycleEnvironments,omitempty"`
	Environments          []*resources.ReferenceDataItem           `json:"Environments"`
	ChannelEnvironments   map[string][]resources.ReferenceDataItem `json:"ChannelEnvironments,omitempty"`
	Releases              []*ReleaseProgression                    `json:"Releases"`

	resources.Resource
}

Progression represents the project level (dashboard-style) progression and current deployed releases for the project

type Project

type Project struct {
	AutoCreateRelease               bool                                      `json:"AutoCreateRelease,omitempty"`
	AutoDeployReleaseOverrides      []AutoDeployReleaseOverride               `json:"AutoDeployReleaseOverrides,omitempty"`
	ClonedFromProjectID             string                                    `json:"ClonedFromProjectId,omitempty"`
	ConnectivityPolicy              *core.ConnectivityPolicy                  `json:"ProjectConnectivityPolicy,omitempty"`
	DefaultGuidedFailureMode        string                                    `json:"DefaultGuidedFailureMode,omitempty"`
	DefaultToSkipIfAlreadyInstalled bool                                      `json:"DefaultToSkipIfAlreadyInstalled,omitempty"`
	DeploymentChangesTemplate       string                                    `json:"DeploymentChangesTemplate,omitempty"`
	DeploymentProcessID             string                                    `json:"DeploymentProcessId,omitempty"`
	Description                     string                                    `json:"Description,omitempty"`
	ExtensionSettings               []ExtensionSettingsValues                 `json:"ExtensionSettings,omitempty"`
	IncludedLibraryVariableSets     []string                                  `json:"IncludedLibraryVariableSetIds,omitempty"`
	IsDisabled                      bool                                      `json:"IsDisabled,omitempty"`
	IsDiscreteChannelRelease        bool                                      `json:"DiscreteChannelRelease,omitempty"`
	IsVersionControlled             bool                                      `json:"IsVersionControlled,omitempty"`
	LifecycleID                     string                                    `json:"LifecycleId" validate:"required"`
	Name                            string                                    `json:"Name" validate:"required"`
	PersistenceSettings             PersistenceSettings                       `json:"PersistenceSettings,omitempty"`
	ProjectGroupID                  string                                    `json:"ProjectGroupId" validate:"required"`
	ReleaseCreationStrategy         *ReleaseCreationStrategy                  `json:"ReleaseCreationStrategy,omitempty"`
	ReleaseNotesTemplate            string                                    `json:"ReleaseNotesTemplate,omitempty"`
	Slug                            string                                    `json:"Slug,omitempty"`
	SpaceID                         string                                    `json:"SpaceId,omitempty"`
	Templates                       []actiontemplates.ActionTemplateParameter `json:"Templates,omitempty"`
	TenantedDeploymentMode          core.TenantedDeploymentMode               `json:"TenantedDeploymentMode,omitempty"`
	VariableSetID                   string                                    `json:"VariableSetId,omitempty"`
	VersioningStrategy              *VersioningStrategy                       `json:"VersioningStrategy,omitempty"`

	resources.Resource
}

func NewProject

func NewProject(name string, lifecycleID string, projectGroupID string) *Project

func (*Project) GetName added in v2.9.1

func (s *Project) GetName() string

func (*Project) UnmarshalJSON

func (p *Project) UnmarshalJSON(data []byte) error

UnmarshalJSON sets this project to its representation in JSON.

func (Project) Validate

func (resource Project) Validate() error

Validate checks the state of the project and returns an error if invalid.

type ProjectPulseQuery

type ProjectPulseQuery struct {
	ProjectIDs []string `uri:"projectIds,omitempty" url:"projectIds,omitempty"`
}

type ProjectService

type ProjectService struct {
	services.CanDeleteService
	// contains filtered or unexported fields
}

func NewProjectService

func NewProjectService(sling *sling.Sling, uriTemplate string, pulsePath string, experimentalSummariesPath string, importProjectsPath string, exportProjectsPath string) *ProjectService

func (*ProjectService) Add

func (s *ProjectService) Add(project *Project) (*Project, error)

Add creates a new project.

func (*ProjectService) ConvertToVcs

func (s *ProjectService) ConvertToVcs(project *Project, commitMessage string, gitPersistenceSettings GitPersistenceSettings) (*Project, error)

ConvertToVcs converts an input project to use a version-control system (VCS) for its persistence.

func (*ProjectService) Get

func (s *ProjectService) Get(projectsQuery ProjectsQuery) (*resources.Resources[*Project], error)

Get returns a collection of projects based on the criteria defined by its input query parameter. If an error occurs, an empty collection is returned along with the associated error.

func (*ProjectService) GetAll

func (s *ProjectService) GetAll() ([]*Project, error)

GetAll returns all projects. If none can be found or an error occurs, it returns an empty collection.

func (*ProjectService) GetByID

func (s *ProjectService) GetByID(id string) (*Project, error)

GetByID returns the project that matches the input ID. If one cannot be found, it returns nil and an error.

func (*ProjectService) GetByIdentifier added in v2.11.0

func (p *ProjectService) GetByIdentifier(identifier string) (*Project, error)

func (*ProjectService) GetByName added in v2.7.0

func (p *ProjectService) GetByName(name string) (*Project, error)

func (*ProjectService) GetChannels

func (s *ProjectService) GetChannels(project *Project) ([]*channels.Channel, error)

func (*ProjectService) GetGitBranch added in v2.3.2

func (s *ProjectService) GetGitBranch(project *Project, name string) (*GitReference, error)

func (*ProjectService) GetGitBranches added in v2.3.2

func (s *ProjectService) GetGitBranches(project *Project) ([]*GitReference, error)

func (*ProjectService) GetGitCommit added in v2.3.2

func (s *ProjectService) GetGitCommit(project *Project, hash string) (*GitReference, error)

func (*ProjectService) GetGitTag added in v2.3.2

func (s *ProjectService) GetGitTag(project *Project, name string) (*GitReference, error)

func (*ProjectService) GetGitTags added in v2.3.2

func (s *ProjectService) GetGitTags(project *Project) ([]*GitReference, error)

func (*ProjectService) GetProgression added in v2.11.0

func (s *ProjectService) GetProgression(project *Project) (*Progression, error)

func (*ProjectService) GetProject

func (s *ProjectService) GetProject(channel *channels.Channel) (*Project, error)

func (*ProjectService) GetReleases

func (s *ProjectService) GetReleases(project *Project) ([]*releases.Release, error)

func (*ProjectService) GetSummary

func (s *ProjectService) GetSummary(project *Project) (*ProjectSummary, error)

func (*ProjectService) Update

func (s *ProjectService) Update(project *Project) (*Project, error)

Update modifies a project based on the one provided as input.

func (*ProjectService) UpdateWithGitRef

func (s *ProjectService) UpdateWithGitRef(project *Project, gitRef string) (*Project, error)

Update modifies a Git-based project based on the one provided as input.

type ProjectSummary

type ProjectSummary struct {
	HasDeploymentProcess bool `json:"HasDeploymentProcess,omitempty"`
	HasRunbooks          bool `json:"HasRunbooks,omitempty"`
}

type ProjectsExperimentalSummariesQuery

type ProjectsExperimentalSummariesQuery struct {
	IDs []string `uri:"ids,omitempty" url:"ids,omitempty"`
}

type ProjectsQuery

type ProjectsQuery struct {
	ClonedFromProjectID string   `url:"clonedFromProjectId"`
	IDs                 []string `uri:"ids,omitempty" url:"ids,omitempty"`
	IsClone             bool     `uri:"clone,omitempty" url:"clone,omitempty"`
	Name                string   `uri:"name,omitempty" url:"name,omitempty"`
	PartialName         string   `uri:"partialName,omitempty" url:"partialName,omitempty"`
	Skip                int      `uri:"skip,omitempty" url:"skip,omitempty"`
	Take                int      `uri:"take,omitempty" url:"take,omitempty"`
}

type ReleaseCreationStrategy

type ReleaseCreationStrategy struct {
	ChannelID                    string                            `json:"ChannelId,omitempty"`
	ReleaseCreationPackage       *packages.DeploymentActionPackage `json:"ReleaseCreationPackage,omitempty"`
	ReleaseCreationPackageStepID string                            `json:"ReleaseCreationPackageStepId,omitempty"`
}

type ReleaseProgression added in v2.4.0

type ReleaseProgression struct {
	Release                 *releases.Release           `json:"Release"`
	Channel                 *channels.Channel           `json:"Channel"`
	Deployments             map[string][]*DashboardItem `json:"Deployments"`
	NextDeployments         []string                    `json:"NextDeployments"`
	HasUnresolvedDefect     bool                        `json:"HasUnresolvedDefect"`
	ReleaseRetentionPeriod  *core.RetentionPeriod       `json:"ReleaseRetentionPeriod"`
	TentacleRetentionPeriod *core.RetentionPeriod       `json:"TentacleRetentionPeriod"`
}

ReleaseProgression represents information about a release within the context of a Project Progression Mirrors ReleaseProgressionResource in the server

type VersioningStrategy

type VersioningStrategy struct {
	DonorPackage       *packages.DeploymentActionPackage `json:"DonorPackage,omitempty"`
	DonorPackageStepID *string                           `json:"DonorPackageStepId,omitempty"`
	Template           string                            `json:"Template,omitempty"`
}

Jump to

Keyboard shortcuts

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