GithubHelp home page GithubHelp logo

nahimnasser / heroku-buildpack-go Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heroku/heroku-buildpack-go

0.0 3.0 0.0 15.02 MB

Go support for Heroku

Home Page: https://devcenter.heroku.com/categories/go

Shell 100.00%

heroku-buildpack-go's Introduction

Heroku Buildpack: Go

This is the Heroku buildpack for Go.

Getting Started

Follow the guide at https://devcenter.heroku.com/articles/getting-started-with-go

There's also a hello world sample app at https://github.com/heroku/go-getting-started

Example

$ ls -A1
.git
Godeps
Procfile
web.go

$ heroku create
Creating polar-waters-4785...
...

$ git push heroku master
...
-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Installing go1.4.1... done
-----> Running: godep go install -tags heroku ./...
-----> Discovering process types
       Procfile declares types -> web

-----> Compressing... done, 1.6MB
-----> Launching... done, v4
       https://polar-waters-4785.herokuapp.com/ deployed to Heroku

This buildpack will detect your repository as Go if it contains a .go file.

This buildpack adds a heroku build constraint, to enable heroku-specific code. See the App Engine build constraints article for more.

Hacking on this Buildpack

To change this buildpack, fork it on GitHub. Push changes to your fork, then create a test app with --buildpack YOUR_GITHUB_GIT_URL and push to it. If you already have an existing app you may use heroku config:add BUILDPACK_URL=YOUR_GITHUB_GIT_URL instead of --buildpack.

Godeps vs .godir

This buildpack supports the use of godep, which will be used to install the project and its vendored dependencies if a Godeps/Godep.json file exists. Otherwise this buildpack requires a file named .godir in the root of your project to determine the name of the project and will use the go toolchain to download dependencies.

See Go Dependencies via Godep for more.

Using with cgo

This buildpack supports building with C dependencies via cgo. You can set config vars to specify CGO flags to, e.g., specify paths for vendored dependencies. E.g., to build gopgsqldriver, add the config var CGO_CFLAGS with the value -I/app/code/vendor/include/postgresql and include the relevant Postgres header files in vendor/include/postgresql/ in your app.

Passing a symbol (and optional string) to the linker

This buildpack supports the go linker's ability (-X symbol value) to set the value of a string at link time. This can be done by setting GO_LINKER_SYMBOL and GO_LINKER_VALUE in the application's config before pushing code. If GO_LINKER_SYMBOL is set, but GO_LINKER_VALUE isn't set then GO_LINKER_VALUE defaults to $SOURCE_VERSION.

This can be used to embed the commit sha, or other build specific data directly into the compiled executable.

heroku-buildpack-go's People

Contributors

attilaolah avatar austinpray avatar bmizerany avatar catsby avatar claymccoy avatar cyberdelia avatar danp avatar elithrar avatar jmazzi avatar josharian avatar jszwedko avatar kr avatar mbren avatar mikehale avatar mmcgrana avatar nahimnasser avatar ryanbrainard avatar surma avatar tt avatar wwy avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.