Last active
May 31, 2017 14:48
-
-
Save devigned/9fa3053d306d1855e81fd373533fae30 to your computer and use it in GitHub Desktop.
Habitat plan for building a Rails application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkg_origin=devigned | |
pkg_name=rails-todo | |
pkg_version=0.1.0 | |
pkg_maintainer="David Justice" | |
pkg_license=('MIT') | |
pkg_upstream_url=https://github.com/devigned/hab-rails-todo | |
pkg_source=nosuchfile.tar.gz | |
pkg_deps=( | |
core/ruby/2.4.1 | |
core/cacerts | |
core/bundler | |
core/coreutils | |
core/openssl | |
) | |
pkg_build_deps=( | |
core/gcc-libs | |
core/gcc | |
core/make | |
core/patch | |
core/node | |
) | |
pkg_exports=( [port]=rails_port ) | |
pkg_exposes=(port) | |
# return 0 since we are using local source | |
do_download() { | |
return 0 | |
} | |
# return 0 since we are using local source | |
do_verify() { | |
return 0 | |
} | |
# return 0 since we are using local source | |
do_unpack() { | |
return 0 | |
} | |
# install bundled dependencies | |
do_build() { | |
cp -R $PLAN_CONTEXT/../src/* $HAB_CACHE_SRC_PATH/$pkg_dirname | |
bundle install --deployment --jobs 2 --retry 5 | |
} | |
# stage files from the build cache into the artifact directory | |
do_install() { | |
cp -R . "${pkg_prefix}/static" | |
for binstub in ${pkg_prefix}/static/bin/*; do | |
[[ -f $binstub ]] && sed -e "s#/usr/bin/env ruby#$(pkg_path_for core/ruby)/bin/ruby#" -i "$binstub" | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment