source

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: BSD-3-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DockerBuildDirectory

func DockerBuildDirectory(c *docker.Client, name, path string) error

func DockerRun

func DockerRun(c *docker.Client, imageName string) (io.ReadCloser, error)

func HaveSSHKey

func HaveSSHKey() bool

Returns true if $HOME/.ssh exists, false otherwise

func PathWithFragment

func PathWithFragment(u *url.URL) string

Represent the path as /foo or /foo#bar if #bar is specified.

Types

type CloseFunc

type CloseFunc func() error

func (CloseFunc) Close

func (fn CloseFunc) Close() error

type CwdSource

type CwdSource struct{}

func (CwdSource) Name

func (CwdSource) Name() (string, error)

func (*CwdSource) Obtain

func (s *CwdSource) Obtain(c *docker.Client, payload []byte) (string, error)

type DockerPullSource

type DockerPullSource struct {
	Repository, Tag string
}

func DockerPullSourceFromImage

func DockerPullSourceFromImage(image string) *DockerPullSource

DockerPullSourceFromImage creates a *DockerPullSource from an image name (with an optional tag)

func (*DockerPullSource) Obtain

func (s *DockerPullSource) Obtain(c *docker.Client, payload []byte) (string, error)

Obtain an image by pulling a docker image from somewhere.

type GitHostSource

type GitHostSource struct {
	Host          string
	User          string
	Repository    string
	InitialBranch string
	// Directory in which to do `docker build`.
	// Uses repository root if blank.
	ImageRoot string
}

func (*GitHostSource) CloneURL

func (s *GitHostSource) CloneURL() string

func (*GitHostSource) Obtain

func (s *GitHostSource) Obtain(c *docker.Client, payload []byte) (string, error)

func (*GitHostSource) Ref

func (s *GitHostSource) Ref(payload []byte) (string, error)

Return the git SHA from the given hook payload, if we have a hook payload, otherwise return the InitialBranch.

type ImageSource

type ImageSource interface {
	// Build/pull/fetch a docker image and return its name as a string
	Obtain(client *docker.Client, payload []byte) (string, error)
}

func GetSourceFromHookbot

func GetSourceFromHookbot(hookbotURLStr string) (string, ImageSource, error)

func NewDockerPullSource

func NewDockerPullSource(hookbotURL *url.URL) (string, ImageSource, error)

func NewGitHostSource

func NewGitHostSource(hookbotURL *url.URL) (string, ImageSource, error)

Jump to

Keyboard shortcuts

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