Giter VIP home page Giter VIP logo

go-buildpack's Introduction

Cloud Foundry Go(Lang) Buildpack

CF Slack

A Cloud Foundry buildpack for Go(lang) based apps.

This is based on the [Heroku buildpack] (https://github.com/heroku/heroku-buildpack-go).

Additional documentation can be found at CloudFoundry.org.

Usage

=======

This buildpack will get used if you have any files with the .go extension in your repository.

cf push my_app -b https://github.com/cloudfoundry/go-buildpack.git

Disconnected environments

To use this buildpack on Cloud Foundry, where the Cloud Foundry instance limits some or all internet activity, please read the Disconnected Environments documentation.

Vendoring app dependencies

As stated in the Disconnected Environments documentation, your application must 'vendor' its dependencies.

For the Go buildpack, use Godep:

cf push uploads your vendored dependencies. The buildpack will compile any dependencies requiring compilation while staging your application.

Building

  1. Make sure you have fetched submodules
git submodule update --init
  1. Get latest buildpack dependencies
BUNDLE_GEMFILE=cf.Gemfile bundle
  1. Build the buildpack
BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-packager [ --uncached | --cached ]
  1. Use in Cloud Foundry

    Upload the buildpack to your Cloud Foundry and optionally specify it by name

    cf create-buildpack custom_go_buildpack go_buildpack-cached-custom.zip 1
    cf push my_app -b custom_go_buildpack

Supported binary dependencies

The buildpack only supports the stable patches for each dependency listed in the manifest.yml and releases page.

If you try to use a binary that is not currently supported, staging your app will fail and you will see the following error message:

       Could not get translated url, exited with: DEPENDENCY_MISSING_IN_MANIFEST: ...
 !
 !     exit
 !
Staging failed: Buildpack compilation step failed

Testing

Buildpacks use the Machete framework for running integration tests.

To test a buildpack, run the following command from the buildpack's directory:

BUNDLE_GEMFILE=cf.Gemfile bundle exec buildpack-build

More options can be found on Machete's Github page.

Contributing

Find our guidelines here.

Dependency managment

.godir

If you use .godir your app will no longer stage.

.godir has been retired in favor of using godep in your project to manage dependencies, and including the generated Godep directory in your git repository.

Godeps

Godeps is the buildpack's only supported package manager. The buildpack will run godep to install your dependencies at staging.

C dependencies

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.

Help and Support

Join the #buildpacks channel in our [Slack community] (http://slack.cloudfoundry.org/)

Reporting Issues

Open an issue on this project

Active Development

The project backlog is on Pivotal Tracker

go-buildpack's People

Contributors

attilaolah avatar bmizerany avatar buddhistpirate avatar crawsible avatar cyberdelia avatar d-lorenc avatar dannyzen avatar danp avatar davidjahn avatar elithrar avatar flavorjones avatar glide1 avatar jordi-pivotal avatar josharian avatar jszwedko avatar jtarchie avatar kr avatar krujos avatar lnguyen avatar lstoll avatar mhoran avatar mikehale avatar mmcgrana avatar nota-ja avatar rochesterinnyc avatar ryanbrainard avatar squeedee avatar styeung 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.