hbuild

package module
v0.0.0-...-539c828 Latest Latest
Warning

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

Go to latest
Published: May 2, 2015 License: MIT Imports: 15 Imported by: 0

README

hbuild

Deploy an app to Heroku without using git.

About

hbuild is a utility for deploying an app to Heroku using its builds API instead of git push heroku master.

Install

Binary Downloads
Compile from Source
$ go get github.com/naaman/hbuild/cmd/hbuild

Command Usage

$ hbuild
Usage of hbuild:
  -app="": -app=exampleapp
  -key="12345678-1234-5678-1234-567812345678": -key=123ABC
  -source="/home/user/code/exampleapp": -source=/path/to/src
$ hbuild -app=exampleapp
Creating source...done.
Compressing source...done.
Uploading source...done.
Building:

-----> PHP app detected
...

Library Usage

// Setup a Source object
source, _ := hbuild.NewSource(apiKey, appName, sourceDir)

// Create a compressed targz of the source
source.Compress()

// Upload the source
source.Upload()

// Run a build
build, _ := hbuild.NewBuild(apiKey, appName, source)

// Watch the build output
io.Copy(os.Stdout, build.Output)

Note: see the hbuild command source for slightly more detail.

TODO

  • Tests
  • Pipeline Compress and Upload

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Id     UUID
	Stream *http.Response
	// contains filtered or unexported fields
}

func NewBuild

func NewBuild(token, app string, source Source, opts BuildOptions) (build Build, err error)

func (*Build) Result

func (b *Build) Result() (BuildResultJSON, error)

func (*Build) Status

func (b *Build) Status() (string, error)

type BuildOptions

type BuildOptions struct {
	SourceVersion     string
	AdditionalHeaders http.Header
}

type BuildRequestJSON

type BuildRequestJSON struct {
	SourceBlob struct {
		Url     string `json:"url"`
		Version string `json:"version"`
	} `json:"source_blob"`
}

type BuildResponseJSON

type BuildResponseJSON struct {
	Id              string `json:"id"`
	OutputStreamURL string `json:"output_stream_url"`
	Status          string `json:"status"`
}

type BuildResultJSON

type BuildResultJSON struct {
	Build struct {
		Id     string `json:"id"`
		Status string `json:"status"`
	} `json:"build"`
	ExitCode int                 `json:"exit_code"`
	Lines    []map[string]string `json:"lines"`
}

type HerokuError

type HerokuError struct {
	Id  string
	URL string
	// contains filtered or unexported fields
}

type HerokuJsonError

type HerokuJsonError struct {
	Message string
	Id      string
	URL     string `json:"url"`
}

type Source

type Source struct {
	Dir     *os.File
	Archive *os.File
	Get     *url.URL
	Put     *url.URL
}

func NewSource

func NewSource(token, app, dir string) (source Source, err error)

func (*Source) Compress

func (s *Source) Compress() (err error)

func (*Source) Upload

func (s *Source) Upload() (err error)

type SourceJSON

type SourceJSON struct {
	SourceBlob struct {
		GetUrl string `json:"get_url"`
		PutUrl string `json:"put_url"`
	} `json:"source_blob"`
}

type UUID

type UUID string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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