deploy

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2015 License: BSD-2-Clause Imports: 17 Imported by: 1

README

GitHub Deployments CLI Build Status

A small Go program for creating GitHub Deployments.

Installation

You can grab the latest release here

Or if you have a working Go 1.4 environment:

go get -u github.com/remind101/deploy/cmd/deploy

Usage

The first time you try to deploy, you'll be asked to authenticate with GitHub. If you're already using hub, then you'll already be authenticated.

Deploy the master branch of a repo to staging:

$ deploy --ref=master --env=staging remind101/acme-inc

An empty --ref flag can mean one of two things:

  1. If you're within a git repo, it defaults to the current branch.
  2. If you're not within a git repo, then it defaults to master.
$ deploy --env=staging remind101/acme-inc

You can default to a certain GitHub organization by setting a GITHUB_ORGANIZATION environment variable:

$ export GITHUB_ORGANIZATION=remind101
$ deploy --env=staging acme-inc

Deploy the current GitHub repo to staging:

$ deploy --env=staging

Don't have something handling your GitHub Deployment events? Try remind101/tugboat or atmos/heaven.

Documentation

Index

Constants

View Source
const (
	Name  = "deploy"
	Usage = "A command for creating GitHub deployments"
)
View Source
const (
	DefaultRef     = "master"
	DefaultTimeout = 20 * time.Second
)
View Source
const GitHubHost = "github.com"
View Source
const Version = "0.0.4"

Variables

View Source
var ProtectedEnvironments = map[string]bool{
	"production": true,
}

Functions

func GitHubRepo

func GitHubRepo(remotes []hub.Remote) string

GitHubRepo, given a list of git remotes, will determine what the GitHub repo is.

func NewApp

func NewApp() *cli.App

NewApp returns a new cli.App for the deploy command.

func Ref

func Ref(ref string, headFunc func() (string, error)) string

Ref attempts to return the proper git ref to deploy. If a ref is provided, that will be returned. If not, it will fallback to calling headFunc. If an error is returned (not in a git repo), then it will fallback to DefaultRef.

func Repo

func Repo(arguments []string) (string, error)

Repo will determine the correct GitHub repo to deploy to, based on a set of arguments.

func RunDeploy

func RunDeploy(c *cli.Context) error

RunDeploy performs a deploy.

func SplitRepo

func SplitRepo(nwo, defaultOrg string) (owner string, repo string, err error)

SplitRepo splits a repo string in the form remind101/acme-inc into it's owner and repo components.

Types

type Updater added in v0.0.4

type Updater struct {
	Host           string
	CurrentVersion string
}

func NewUpdater added in v0.0.4

func NewUpdater() *Updater

func (*Updater) Update added in v0.0.4

func (updater *Updater) Update() (err error)

Directories

Path Synopsis
Godeps
_workspace/src/bitbucket.org/kardianos/osext
Extensions to the standard "os" package.
Extensions to the standard "os" package.
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
Package cli provides a minimal framework for creating and organizing command line Go applications.
_workspace/src/github.com/fhs/go-netrc/netrc
Package netrc implements a parser for netrc file format.
Package netrc implements a parser for netrc file format.
_workspace/src/github.com/github/hub/Godeps/_workspace/src/github.com/fhs/go-netrc/netrc
Package netrc implements a parser for netrc file format.
Package netrc implements a parser for netrc file format.
_workspace/src/github.com/github/hub/Godeps/_workspace/src/github.com/jingweno/go-sawyer/hypermedia
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests.
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests.
_workspace/src/github.com/github/hub/Godeps/_workspace/src/github.com/jingweno/go-sawyer/mediatype
Package mediatype contains helpers for parsing media type strings.
Package mediatype contains helpers for parsing media type strings.
_workspace/src/github.com/github/hub/Godeps/_workspace/src/github.com/jtacoma/uritemplates
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
_workspace/src/github.com/github/hub/Godeps/_workspace/src/github.com/kballard/go-shellquote
Shellquote provides utilities for joining/splitting strings using sh's word-splitting rules.
Shellquote provides utilities for joining/splitting strings using sh's word-splitting rules.
Package isatty implements interface to isatty
_workspace/src/github.com/github/hub/Godeps/_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/github.com/github/hub/Godeps/_workspace/src/gopkg.in/yaml.v1
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
_workspace/src/github.com/google/go-github/github
Package github provides a client for using the GitHub API.
Package github provides a client for using the GitHub API.
_workspace/src/github.com/google/go-querystring/query
Package query implements encoding of structs into URL query parameters.
Package query implements encoding of structs into URL query parameters.
_workspace/src/github.com/inconshreveable/go-update
go-update allows a program to update itself by replacing its executable file with a new version.
go-update allows a program to update itself by replacing its executable file with a new version.
_workspace/src/github.com/jingweno/go-sawyer/hypermedia
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests.
Package hypermedia provides helpers for parsing hypermedia links in resources and expanding the links to make further requests.
_workspace/src/github.com/jingweno/go-sawyer/mediatype
Package mediatype contains helpers for parsing media type strings.
Package mediatype contains helpers for parsing media type strings.
_workspace/src/github.com/jtacoma/uritemplates
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
Package uritemplates is a level 4 implementation of RFC 6570 (URI Template, http://tools.ietf.org/html/rfc6570).
_workspace/src/github.com/kballard/go-shellquote
Shellquote provides utilities for joining/splitting strings using sh's word-splitting rules.
Shellquote provides utilities for joining/splitting strings using sh's word-splitting rules.
_workspace/src/github.com/kr/binarydist
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
Package binarydist implements binary diff and patch as described on http://www.daemonology.net/bsdiff/.
_workspace/src/github.com/kr/pretty
Package pretty provides pretty-printing for Go values.
Package pretty provides pretty-printing for Go values.
_workspace/src/github.com/kr/text
Package text provides rudimentary functions for manipulating text in paragraphs.
Package text provides rudimentary functions for manipulating text in paragraphs.
_workspace/src/github.com/kr/text/colwriter
Package colwriter provides a write filter that formats input lines in multiple columns.
Package colwriter provides a write filter that formats input lines in multiple columns.
_workspace/src/github.com/kr/text/mc command
Command mc prints in multiple columns.
Command mc prints in multiple columns.
_workspace/src/github.com/mattn/go-isatty
Package isatty implements interface to isatty
Package isatty implements interface to isatty
_workspace/src/github.com/ogier/pflag
pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
pflag is a drop-in replacement for Go's flag package, implementing POSIX/GNU-style --flags.
_workspace/src/golang.org/x/crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
_workspace/src/gopkg.in/yaml.v1
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
cmd
deploy command

Jump to

Keyboard shortcuts

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