{"modulePath":"github.com/Coding/drone","version":"v0.3.1","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package script\n\n## Constants\n\n```go\nconst (\n\tDefaultDockerNetworkMode = \"bridge\"\n)\n```\n\n## Functions\n\n```go\nfunc DockerHostname(d *Docker) string\n```\nDockerHostname returns empty string when Docker.NetworkMode is empty. DockerNetworkMode returns Docker.NetworkMode when it is not empty.\n\n```go\nfunc DockerNetworkMode(d *Docker) string\n```\nDockerNetworkMode returns DefaultNetworkMode when Docker.NetworkMode is empty. DockerNetworkMode returns Docker.NetworkMode when it is not empty.\n\n```go\nfunc DockerTty(d *Docker) bool\n```\nDockerTty returns true if the build should allocate a pseudo tty\n\n```go\nfunc Inject(script string, params map[string]string) string\n```\n\n## Types\n\n```go\ntype Build struct {\n\t// Image specifies the Docker Image that will be\n\t// used to virtualize the Build process.\n\tImage string\n\n\t// Name specifies a user-defined label used\n\t// to identify the build.\n\tName string\n\n\t// Script specifies the build and test commands.\n\tScript []string\n\n\t// Env specifies the environment of the build.\n\tEnv []string\n\n\t// Hosts specifies the custom IP address and\n\t// hostname mappings.\n\tHosts []string\n\n\t// Cache lists a set of directories that should\n\t// persisted between builds.\n\tCache []string\n\n\t// Services specifies external services, such as\n\t// database or messaging queues, that should be\n\t// linked to the build environment.\n\tServices []string\n\n\t// White-list of Branches that are built.\n\tBranches []string\n\n\tDeploy        *deploy.Deploy       `yaml:\"deploy,omitempty\"`\n\tPublish       *publish.Publish     `yaml:\"publish,omitempty\"`\n\tNotifications *notify.Notification `yaml:\"notify,omitempty\"`\n\n\t// Git specified git-specific parameters, such as\n\t// the clone depth and path\n\tGit *git.Git `yaml:\"git,omitempty\"`\n\n\t// Docker container parameters, such as\n\t// NetworkMode and UserName\n\tDocker *Docker `yaml:\"docker,omitempty\"`\n}\n```\nBuild stores the configuration details for building, testing and deploying code.\n\n```go\nfunc ParseBuild(data string) (*Build, error)\n```\n\n```go\nfunc ParseBuildFile(filename string, params map[string]string) (*Build, error)\n```\n\n```go\nfunc (b *Build) MatchBranch(branch string) bool\n```\n\n```go\nfunc (b *Build) Write(f *buildfile.Buildfile, r *repo.Repo)\n```\nWrite adds all the steps to the build script, including build commands, deploy and publish commands.\n\n```go\nfunc (b *Build) WriteBuild(f *buildfile.Buildfile)\n```\nWriteBuild adds only the build steps to the build script, omitting publish and deploy steps. This is important for pull requests, where deployment would be undesirable.\n\n```go\ntype Context interface {\n\tHost() string\n\tOwner() string\n\tName() string\n\n\tBranch() string\n\tHash() string\n\tStatus() string\n\tMessage() string\n\tAuthor() string\n\tGravatar() string\n\n\tDuration() int64\n\tHumanDuration() string\n}\n```\n\n```go\ntype Deployment interface {\n\tWrite(f *buildfile.Buildfile)\n}\n```\n\n```go\ntype Docker struct {\n\t// NetworkMode (also known as `--net` option)\n\t// Could be set only if Docker is running in privileged mode\n\tNetworkMode *string `yaml:\"net,omitempty\"`\n\n\t// Hostname (also known as `--hostname` option)\n\t// Could be set only if Docker is running in privileged mode\n\tHostname *string `yaml:\"hostname,omitempty\"`\n\n\t// Allocate a pseudo-TTY (also known as `--tty` option)\n\tTTY bool `yaml:\"tty,omitempty\"`\n}\n```\nDocker stores the configuration details for configuring docker container.\n\n```go\ntype Notification interface {\n\tSet(c Context)\n}\n```\n\n```go\ntype Publish interface {\n\tWrite(f *buildfile.Buildfile)\n}\n```\n\n","path":"github.com/Coding/drone/shared/build/script","name":"script","synopsis":"","isRedistributable":true}
