Skip to content

Instantly share code, notes, and snippets.

@mlafeldt
Created January 9, 2015 10:47
Show Gist options
  • Save mlafeldt/b3a87ba99c75217ab9ee to your computer and use it in GitHub Desktop.
Save mlafeldt/b3a87ba99c75217ab9ee to your computer and use it in GitHub Desktop.

Revisions

  1. mlafeldt created this gist Jan 9, 2015.
    36 changes: 36 additions & 0 deletions recipe.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    class ChefRunner < FPM::Cookery::Recipe
    GOPACKAGE = "github.com/mlafeldt/chef-runner"

    name "chef-runner"
    version "0.8.0"
    revision 1
    source "https://#{GOPACKAGE}/archive/v#{version}.tar.gz"
    sha256 "a7de23f989f8353ecf838b551a8ceff09b83c8aeff2553b2c31d57615f8fcc53"

    description "The fastest way to run Chef cookbooks"
    homepage "https://#{GOPACKAGE}"
    maintainer "Mathias Lafeldt <[email protected]>"
    license "Apache 2.0"
    section "development"

    build_depends %w(golang-go git)

    def build
    pkgdir = builddir("gobuild/src/#{GOPACKAGE}")
    mkdir_p pkgdir
    cp_r Dir["*"], pkgdir

    ENV["GOPATH"] = [
    builddir("gobuild/src/#{GOPACKAGE}/Godeps/_workspace"),
    builddir("gobuild"),
    ].join(":")

    safesystem "go version"
    safesystem "go env"
    safesystem "go get -v #{GOPACKAGE}/..."
    end

    def install
    bin.install builddir("gobuild/bin/chef-runner")
    end
    end