scm

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2016 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var New = func() (SCM, error) {
	scmtype := config.Get("scm.type")
	if scmtype == "" {
		return nil, fmt.Errorf("The SCM plugin does not configured")
	}
	return nil, fmt.Errorf("Unsupported SCM type: %s", scmtype)
}

Functions

func DeployRepository

func DeployRepository(cli container.DockerClient, ctx context.Context, name, namespace string, in io.Reader, stdout, stderr io.Writer) error

DeployRepository is a helper function used by SCM implementations to deploy an application repository.

Types

type Branch

type Branch struct {
	// The branch identifier, this is a ref-id for git SCM.
	Id string `json:"id"`

	// The display identifier.
	DisplayId string `json:"displayId,omitempty"`

	// The branch type, such as "BRANCH" or "TAG"
	Type string `json:"type,omitempty"`
}

A branch of deployment.

type InvalidKeyError

type InvalidKeyError struct{}

func (InvalidKeyError) Error

func (e InvalidKeyError) Error() string

func (InvalidKeyError) HTTPStatusCode

func (e InvalidKeyError) HTTPStatusCode() int

type NamespaceExistError

type NamespaceExistError string

func (NamespaceExistError) Error

func (e NamespaceExistError) Error() string

func (NamespaceExistError) HTTPErrorStatusCode

func (e NamespaceExistError) HTTPErrorStatusCode() int

type NamespaceNotFoundError

type NamespaceNotFoundError string

func (NamespaceNotFoundError) Error

func (e NamespaceNotFoundError) Error() string

func (NamespaceNotFoundError) HTTPErrorStatusCode

func (e NamespaceNotFoundError) HTTPErrorStatusCode() int

type RepoExistError

type RepoExistError string

func (RepoExistError) Error

func (e RepoExistError) Error() string

func (RepoExistError) HTTPStatusCode

func (e RepoExistError) HTTPStatusCode() int

type RepoNotFoundError

type RepoNotFoundError string

func (RepoNotFoundError) Error

func (e RepoNotFoundError) Error() string

func (RepoNotFoundError) HTTPStatusCode

func (e RepoNotFoundError) HTTPStatusCode() int

type SCM

type SCM interface {
	// Type returns the SCM type, such as "git", "hg", etc.
	Type() string

	// Create a namespace in the SCM.
	// For user based SCM, a new user is created.
	// For project based SCM, a new project is created.
	// Otherwise, the SCM must have maintain a database to manage namespaces
	// and repositories.
	CreateNamespace(namespace string) error

	// Remove the namespace from SCM. All repositories in the namespace
	// are also removed.
	RemoveNamespace(namespace string) error

	// Create a new repository with the given name in the given namespace.
	CreateRepo(namespace, name string) error

	// Remove the repository with the given name in the given namespace.
	RemoveRepo(namespace, name string) error

	// Populate repository from a template.
	Populate(namespace, name string, payload io.Reader, size int64) error

	// Populate repository from an URL.
	PopulateURL(namespace, name string, url string) error

	// Deploy application with new commit.
	Deploy(namespace, name string, branch string) error

	// Deploy application with new commit. Log build output to the give writer.
	DeployWithLog(namespace, name string, branch string, stdout, stderr io.Writer) error

	// Get the current deployment branch.
	GetDeploymentBranch(namespace, name string) (*Branch, error)

	// Get all deployment branches.
	GetDeploymentBranches(namespace, name string) ([]*Branch, error)

	// Add an SSH key to the given namespace.
	AddKey(namespace string, key string) error

	// Remove an SSH key from the given namespace.
	RemoveKey(namespace string, key string) error

	// List all SSH keys in the given namespace.
	ListKeys(namespace string) ([]SSHKey, error)
}

Source Code Management interface.

type SSHKey

type SSHKey struct {
	Label string
	Text  string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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