This repository has been archived by the owner. It is now read-only.

Config merging; build environment variables #6

Merged
merged 2 commits into from Jul 7, 2012

Conversation

Projects
None yet
3 participants
@bernerdschaefer
Contributor

bernerdschaefer commented Jul 6, 2012

This commit includes two separate but related features:

  1. Instead of only taking the last release config, the YAML is parsed and merged after each step. It's quite dumb now, just a "deep merge" on the values emitted by each step, but could be upgraded to even, say, merge "PATH" settings, etc.
  2. It adds awareness for a custom key in bin/release's yaml: build_env. It's like config_vars, except that each stage in a multi-build is run with the combined build_env of each previous step.

I'd like some feedback on this, but here's my use case:

I needed libcairo (with development dependencies), which isn't available on heroku. So I put together a buildpack for it, but realized there was no way to pass information from my buildpack into the ruby build pack for installing the "cairo" gem.

So now my cairo buildpack now does this in bin/release:

#!/bin/sh
# bin/release <build-dir>

set -e

BUILD_DIR=$1

LIB_PATH="$BUILD_DIR/vendor/cairo/lib:$BUILD_DIR/vendor/pixman-0.26/lib"
INCLUDE_PATH="$BUILD_DIR/vendor/cairo/include/cairo:$BUILD_DIR/vendor/pixman-0.26/include/pixman-1"
PKG_CONFIG_PATH="$BUILD_DIR/vendor/cairo/lib/pkgconfig:$BUILD_DIR/vendor/pixman-0.26/lib/pkgconfig"

cat << EOF

---
build_env:
  BUNDLE_BUILD__CAIRO: "--with-opt-lib=${LIB_PATH} --with-opt-include=${INCLUDE_PATH} --with-pkg-config=${PKG_CONFIG_PATH}"
config_vars:
  PATH: "bin:/app/vendor/cairo/bin:/usr/local/bin:/usr/bin:/bin"
EOF

So that a user can do a multi-build pack with cairo + ruby, do 'gem "cairo"', and everything just works!

bernerdschaefer added some commits Jul 6, 2012

Merge release configurations for each framework
Also adds support for a 'build_env' key in the release yaml for updating
the config used on the build server.

ddollar added a commit that referenced this pull request Jul 7, 2012

Merge pull request #6 from bernerdschaefer/build-env-with-config-merging
Config merging; build environment variables

@ddollar ddollar merged commit 35ae1fe into ddollar:master Jul 7, 2012

@ddollar

This comment has been minimized.

Show comment
Hide comment
@ddollar

ddollar Jul 7, 2012

Owner

This is awesome, thanks!

Owner

ddollar commented Jul 7, 2012

This is awesome, thanks!

ddollar added a commit that referenced this pull request Jul 10, 2012

Revert "Merge pull request #6 from bernerdschaefer/build-env-with-con…
…fig-merging"

This reverts commit 35ae1fe, reversing
changes made to 69f4e67.
@timshadel

This comment has been minimized.

Show comment
Hide comment
@timshadel

timshadel Jul 13, 2012

What triggered the revert? Just curious..

What triggered the revert? Just curious..

@ddollar

This comment has been minimized.

Show comment
Hide comment
@ddollar

ddollar Jul 13, 2012

Owner

#7

Owner

ddollar commented Jul 13, 2012

#7

tomjack pushed a commit to loku/heroku-buildpack-multi that referenced this pull request Jul 16, 2012

Tom Jack
Revert "Revert "Merge pull request #6 from bernerdschaefer/build-env-…
…with-config-merging""

This reverts commit 2a4cefc.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.