It has been a long time since Vulcan has been deprecated. Now, gcc is no longer available at runtime on heroku-16 so Vesuvius comes in help.

Why Vesuvius?

Vulcan has been deprecated and GCC is only available at build time on heroku-16 stack.

Even with heroku run bash, compiling stuff on Heroku was painful, time consuming, and you needed a third-party cloud storage to move your compiled library in order to download it.

With Vesuvius, this is no longer the case. During the deploy, Vesuvius will run all scripts located in /scripts/libraries and will move output files to a public directory.

It comes with proj.4 and GEOS as examples.

Automatic Setup

Deploy

Manual Setup

  1. Clone the repo at https://github.com/tagliala/vesuvius
  2. Create a new Heroku application
  3. Set your buildpack to Heroku’s default Ruby buildpack
heroku buildpacks:set heroku/ruby
  1. Append the buildpack-ruby-rake-deploy-tasks to your buildpack list
heroku buildpacks:add https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks
  1. Configure DEPLOY_TASK environment variable
heroku config:set DEPLOY_TASKS=build_libraries

Deploy and navigate to your application’s root path.

Example script

All you need to do is create a bash script to compile your library.

This is an example for the GEOS library:

#!/bin/bash

LIBRARY_VERSION=3.6.2

curl -O http://download.osgeo.org/geos/geos-${LIBRARY_VERSION}.tar.bz2 \
  && tar -xjvf geos-${LIBRARY_VERSION}.tar.bz2 \
  && cd geos-${LIBRARY_VERSION} \
  && ./configure --prefix=${HEROKU_VENDOR_DIR} \
  && make && make install \
  && tar -C ${HEROKU_VENDOR_DIR} -czvf ${TARGET_DIR}/geos-${LIBRARY_VERSION}-heroku.tar.gz .

References


blog comments powered by Disqus