Giter Site home page Giter Site logo

go-buildpack's Introduction

Buildpack: Go

This is a buildpack for Go.

Getting Started

Follow the guide at http://doc.scalingo.eu/languages/go.

There's also a hello world sample app at https://github.com/Scalingo/sample-go-martini.

Example

$ ls -A1
.git
Godeps
Procfile
web.go

$ scalingo create my-go-app
$ git push scalingo master
...
-----> Fetching custom git buildpack... done
-----> Go app detected
-----> Installing go1.4.2... done
-----> Running: godep go install -tags paas ./...
-----> 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.

The buildpack adds a paas build constraint, to enable Platform as a Service specific code. See the App Engine build constraints article for more.

.godir and Godeps

Early versions of this buildpack required users to create a .godir file in the root of the project, containing the application name in order to build the project. While using a .godir file is still supported, it has been deprecated in favor of using godep in your project to manage dependencies, and including the generated Godep directory in your git repository.

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.

Setting the version at build time

If you set the GO_GIT_DESCRIBE_SYMBOL to the name of a string variable, it will be set at build time to the output of git describe --tags --always. This lets you access the commit id or tag in your app. For example, in your main.go:

package main

var version string

To set this variable at build time, set the config var:

$ scalingo env-set GO_GIT_DESCRIBE_SYMBOL=main.version

go-buildpack's People

Contributors

kr avatar bmizerany avatar mmcgrana avatar ryanbrainard avatar josharian avatar soulou avatar attilaolah avatar danp avatar wwy avatar jszwedko avatar cyberdelia avatar mikehale avatar elithrar avatar jmazzi avatar catsby avatar claymccoy avatar surma avatar

Watchers

 avatar James Cloos 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.