deploy

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2016 License: BSD-2-Clause Imports: 17 Imported by: 0

README

GitHub Deployments CLI

Circle CI

A small Go program for creating GitHub Deployments.

Installation

You can grab the latest release here

Or if you have a working Go 1.5 environment and the GO15VENDOREXPERIMENT variable enabled:

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.5"

Variables

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

Functions

func AliasEnvironment added in v0.0.5

func AliasEnvironment(env string) string

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
cmd

Jump to

Keyboard shortcuts

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