Documentation
¶
Index ¶
- Constants
- func UnmarshalYAML(content []byte, c *Config) error
- type Author
- type Branch
- type Commit
- type CommitFile
- type Config
- type DynamicPayload
- type Env
- func (e *Env) HasReview() bool
- func (e *Env) IsAutoDeployOn(ref string) (bool, error)
- func (e *Env) IsDeployableRef(ref string) (bool, error)
- func (e *Env) IsDynamicPayloadEnabled() bool
- func (e *Env) IsFreezed(t time.Time) (bool, error)
- func (e *Env) IsProductionEnvironment() bool
- func (e *Env) ValidateDynamicPayload(values map[string]interface{}) error
- type EvalValues
- type FrozenWindow
- type Input
- type InputType
- type License
- type LicenseKind
- type RateLimit
- type RemoteDeployment
- type RemoteDeploymentStatus
- type RemoteRepo
- type RemoteRepoPerm
- type RemoteUser
- type Review
- type SigningData
- type Status
- type StatusState
- type Tag
- type WebhookConfig
Constants ¶
View Source
const ( VarnameDeployTask = "GITPLOY_DEPLOY_TASK" VarnameRollbackTask = "GITPLOY_ROLLBACK_TASK" VarnameIsRollback = "GITPLOY_IS_ROLLBACK" )
View Source
const ( // DefaultDeployTask is the value of the 'GITPLOY_DEPLOY_TASK' variable. DefaultDeployTask = "deploy" // DefaultRollbackTask is the value of the 'GITPLOY_ROLLBACK_TASK' variable. DefaultRollbackTask = "rollback" )
View Source
const ( TrialMemberLimit = 5 TrialDeploymentLimit = 5000 InfiniteMemberLimit = math.MaxInt InfiniteDeploymentLimit = math.MaxInt )
Variables ¶
This section is empty.
Functions ¶
func UnmarshalYAML ¶
Types ¶
type CommitFile ¶
type Config ¶
type Config struct { Envs []*Env `json:"envs" yaml:"envs"` // contains filtered or unexported fields }
func (*Config) Eval ¶
func (c *Config) Eval(v *EvalValues) error
type DynamicPayload ¶
type DynamicPayload struct { Enabled bool `json:"enabled" yaml:"enabled"` Inputs map[string]Input `json:"inputs" yaml:"inputs"` }
DynamicPayload can be set to dynamically fill in the payload.
func (*DynamicPayload) Validate ¶
func (dp *DynamicPayload) Validate(values map[string]interface{}) (err error)
Validate validates the payload.
type Env ¶
type Env struct { Name string `json:"name" yaml:"name"` // GitHub parameters of deployment. Task *string `json:"task" yaml:"task"` Description *string `json:"description" yaml:"description"` AutoMerge *bool `json:"auto_merge" yaml:"auto_merge"` RequiredContexts *[]string `json:"required_contexts,omitempty" yaml:"required_contexts"` Payload interface{} `json:"payload" yaml:"payload"` DynamicPayload *DynamicPayload `json:"dynamic_payload" yaml:"dynamic_payload"` ProductionEnvironment *bool `json:"production_environment" yaml:"production_environment"` // DeployableRef validates the ref is deployable or not. DeployableRef *string `json:"deployable_ref" yaml:"deployable_ref"` // AutoDeployOn deploys automatically when the pattern is matched. AutoDeployOn *string `json:"auto_deploy_on" yaml:"auto_deploy_on"` // Serialization verify if there is a running deployment. Serialization *bool `json:"serialization" yaml:"serialization"` // Review is the configuration of Review, // It is disabled when it is empty. Review *Review `json:"review,omitempty" yaml:"review"` // FrozenWindows is the list of windows to freeze deployments. FrozenWindows []FrozenWindow `json:"frozen_windows" yaml:"frozen_windows"` }
func (*Env) IsAutoDeployOn ¶
IsAutoDeployOn verifies the ref is matched with 'auto_deploy_on'.
func (*Env) IsDeployableRef ¶
IsDeployableRef verifies the ref is deployable.
func (*Env) IsDynamicPayloadEnabled ¶
func (*Env) IsFreezed ¶
IsFreezed verifies whether the current time is in a freeze window. It returns an error when parsing an expression is failed.
func (*Env) IsProductionEnvironment ¶
IsProductionEnvironment verifies whether the environment is production or not.
func (*Env) ValidateDynamicPayload ¶
type EvalValues ¶
type EvalValues struct {
IsRollback bool
}
type FrozenWindow ¶
type Input ¶
type Input struct { Type InputType `json:"type" yaml:"type"` Required *bool `json:"required" yaml:"required"` Default *interface{} `json:"default" yaml:"default"` Description *string `json:"description" yaml:"description"` Options *[]string `json:"options" yaml:"options"` }
Input defines specifications for input values.
type License ¶
type License struct { Kind LicenseKind `json:"kind"` MemberCount int `json:"member_count"` MemberLimit int `json:"memeber_limit"` DeploymentCount int `json:"deployment_count"` DeploymentLimit int `json:"deployment_limit"` ExpiredAt time.Time `json:"expired_at"` }
func NewOSSLicense ¶
func NewOSSLicense() *License
func NewStandardLicense ¶
func NewStandardLicense(memberCnt int, d *SigningData) *License
func NewTrialLicense ¶
func (*License) IsOverLimit ¶
IsOverLimit verify it is over the limit of the license.
func (*License) IsStandard ¶
type LicenseKind ¶
type LicenseKind string
const ( // LicenseKindOSS is a license for the community edition. LicenseKindOSS LicenseKind = "oss" // LicenseKindTrial is a trial license of the enterprise edition. LicenseKindTrial LicenseKind = "trial" // LicenseKindStandard is a license of the enterprise edition. LicenseKindStandard LicenseKind = "standard" )
type RemoteDeployment ¶
type RemoteDeploymentStatus ¶
type RemoteRepo ¶
type RemoteRepo struct { ID int64 `json:"id"` Namespace string `json:"namespace"` Name string `json:"name"` Description string `json:"description"` Perm RemoteRepoPerm `json:"repo_perm"` }
type RemoteRepoPerm ¶
type RemoteRepoPerm string
const ( RemoteRepoPermRead RemoteRepoPerm = "read" RemoteRepoPermWrite RemoteRepoPerm = "write" RemoteRepoPermAdmin RemoteRepoPerm = "admin" )
type RemoteUser ¶
type SigningData ¶
type SigningData struct { MemberLimit int `json:"memeber_limit"` ExpiredAt time.Time `json:"expired_at"` }
SigningData marshal and unmarshal the content of license.
type Status ¶
type Status struct { Context string `json:"context"` AvatarURL string `json:"avatar_url"` TargetURL string `json:"target_url"` State StatusState `json:"state"` }
type StatusState ¶
type StatusState string
const ( StatusStateSuccess StatusState = "success" StatusStateFailure StatusState = "failure" StatusStatePending StatusState = "pending" StatusStateCancelled StatusState = "cancelled" StatusStateSkipped StatusState = "skipped" )
type WebhookConfig ¶
Click to show internal directories.
Click to hide internal directories.