codefresh

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 22

Documentation

Index

Constants

View Source
const (
	KubernetesRunnerType = "kubernetes"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptions

type AuthOptions struct {

	// Token - Codefresh token
	Token string
}

AuthOptions

type ClientOptions added in v0.2.1

type ClientOptions struct {
	Auth  AuthOptions
	Debug bool
	Host  string
}

Options

type Codefresh

type Codefresh interface {
	Pipelines() IPipelineAPI
	Tokens() ITokenAPI
	RuntimeEnvironments() IRuntimeEnvironmentAPI
	Workflows() IWorkflowAPI
	// contains filtered or unexported methods
}

func New

func New(opt *ClientOptions) Codefresh

type CreateResponse added in v0.4.0

type CreateResponse struct {
	Name string
}

type CreateRuntimeOptions added in v0.1.0

type CreateRuntimeOptions struct {
	Cluster            string
	Namespace          string
	HasAgent           bool
	StorageClass       string
	RunnerType         string
	DockerDaemonParams string
	NodeSelector       map[string]string
	Annotations        map[string]string
}

type DockerDaemonScheduler added in v0.3.0

type DockerDaemonScheduler struct {
	Cluster struct {
		ClusterProvider struct {
			AccountID string `json:"accountId"`
			Selector  string `json:"selector"`
		} `json:"clusterProvider"`
		Namespace string `json:"namespace"`
	} `json:"cluster"`
	UserAccess bool `json:"userAccess"`
}

type IPipelineAPI

type IPipelineAPI interface {
	List(qs map[string]string) ([]*Pipeline, error)
	Run(string, *RunOptions) (string, error)
}

IPipelineAPI declers Codefresh pipeline API

type IRuntimeEnvironmentAPI added in v0.1.0

type IRuntimeEnvironmentAPI interface {
	Create(*CreateRuntimeOptions) (*RuntimeEnvironment, error)
	Validate(*ValidateRuntimeOptions) error
	SignCertificate(*SignCertificatesOptions) ([]byte, error)
	Get(string) (*RuntimeEnvironment, error)
	List() ([]*RuntimeEnvironment, error)
	Delete(string) (bool, error)
	Default(string) (bool, error)
}

IRuntimeEnvironmentAPI declers Codefresh runtime environment API

type ITokenAPI

type ITokenAPI interface {
	Create(name string, subject string) (*Token, error)
	List() ([]*Token, error)
}

type IWorkflowAPI added in v0.6.0

type IWorkflowAPI interface {
	WaitForStatus(string, string, time.Duration, time.Duration) error
	Get(string) (*Workflow, error)
}

type Pipeline

type Pipeline struct {
	Metadata PipelineMetadata `json:"metadata"`
	Spec     PipelineSpec     `json:"spec"`
}

type PipelineMetadata

type PipelineMetadata struct {
	Name     string `json:"name"`
	IsPublic bool   `json:"isPublic"`
	Labels   struct {
		Tags []string `json:"tags"`
	} `json:"labels"`
	Deprecate struct {
		ApplicationPort string `json:"applicationPort"`
		RepoPipeline    bool   `json:"repoPipeline"`
	} `json:"deprecate"`
	OriginalYamlString string    `json:"originalYamlString"`
	AccountID          string    `json:"accountId"`
	CreatedAt          time.Time `json:"created_at"`
	UpdatedAt          time.Time `json:"updated_at"`
	Project            string    `json:"project"`
	ID                 string    `json:"id"`
}

type PipelineSpec

type PipelineSpec struct {
	Triggers []struct {
		Type     string   `json:"type"`
		Repo     string   `json:"repo"`
		Events   []string `json:"events"`
		Provider string   `json:"provider"`
		Context  string   `json:"context"`
	} `json:"triggers"`
	Contexts  []interface{} `json:"contexts"`
	Variables []struct {
		Key   string `json:"key"`
		Value string `json:"value"`
	} `json:"variables"`
	Steps  map[string]interface{} `json:"steps"`
	Stages []interface{}          `json:"stages"`
	Mode   string                 `json:"mode"`
}

type RunOptions added in v0.7.0

type RunOptions struct {
	Branch    string
	Variables map[string]string
}

type RuntimeEnvironment added in v0.1.0

type RuntimeEnvironment struct {
	Version               int                   `json:"version"`
	Metadata              RuntimeMetadata       `json:"metadata"`
	Extends               []string              `json:"extends"`
	Description           string                `json:"description"`
	AccountID             string                `json:"accountId"`
	RuntimeScheduler      RuntimeScheduler      `json:"runtimeScheduler"`
	DockerDaemonScheduler DockerDaemonScheduler `json:"dockerDaemonScheduler"`
	Status                struct {
		Message   string    `json:"message"`
		UpdatedAt time.Time `json:"updated_at"`
	} `json:"status"`
}

type RuntimeMetadata added in v0.3.0

type RuntimeMetadata struct {
	Agent        bool   `json:"agent"`
	Name         string `json:"name"`
	ChangedBy    string `json:"changedBy"`
	CreationTime string `json:"creationTime"`
}

type RuntimeScheduler added in v0.3.0

type RuntimeScheduler struct {
	Cluster struct {
		ClusterProvider struct {
			AccountID string `json:"accountId"`
			Selector  string `json:"selector"`
		} `json:"clusterProvider"`
		Namespace string `json:"namespace"`
	} `json:"cluster"`
	UserAccess bool `json:"userAccess"`
	Pvcs       struct {
		Dind struct {
			StorageClassName string `yaml:"storageClassName"`
		} `yaml:"dind"`
	} `yaml:"pvcs"`
}

type SignCertificatesOptions added in v0.2.0

type SignCertificatesOptions struct {
	AltName string
	CSR     string
}

type Token

type Token struct {
	ID          string    `json:"_id"`
	Name        string    `json:"name"`
	TokenPrefix string    `json:"tokenPrefix"`
	Created     time.Time `json:"created"`
	Subject     struct {
		Type string `json:"type"`
		Ref  string `json:"ref"`
	} `json:"subject"`
	Value string
}

type ValidateRuntimeOptions added in v0.2.0

type ValidateRuntimeOptions struct {
	Cluster   string
	Namespace string
}

type Workflow added in v0.6.0

type Workflow struct {
	ID                 string    `json:"id"`
	Status             string    `json:"status"`
	UserYamlDescriptor string    `json:"userYamlDescriptor"`
	Progress           string    `json:"progress"`
	Created            time.Time `json:"created"`
	Updated            time.Time `json:"updated"`
	Finished           time.Time `json:"finished"`
}

Jump to

Keyboard shortcuts

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