All Projects → heroku → buildpack-stdlib

heroku / buildpack-stdlib

Licence: BSD-3-Clause license
[DEPRECATED] A standard library for Heroku buildpacks written in bash.

Programming Languages

shell
77523 projects
python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to buildpack-stdlib

heroku-buildpack-graphviz
Install Graphviz on Heroku
Stars: ✭ 18 (-5.26%)
Mutual labels:  buildpack, heroku-buildpack
Create React App Buildpack
⚛️ Heroku Buildpack for create-react-app: static hosting for React.js web apps
Stars: ✭ 3,161 (+16536.84%)
Mutual labels:  buildpack, heroku-buildpack
heroku-buildpack-tex
A Heroku buildpack to run TeX Live inside a dyno.
Stars: ✭ 18 (-5.26%)
Mutual labels:  buildpack, heroku-buildpack
Heroku Pinger
😴 Keep your free Heroku dynos awake
Stars: ✭ 84 (+342.11%)
Mutual labels:  heroku-buildpack
Subdir Heroku Buildpack
Allows to use subdirectory configured via environment variable as a project root
Stars: ✭ 211 (+1010.53%)
Mutual labels:  heroku-buildpack
Reddit Bot
🤖 Making a Reddit Bot using Python, Heroku and Heroku Postgres.
Stars: ✭ 99 (+421.05%)
Mutual labels:  heroku-buildpack
tomee-buildpack
Cloud Foundry buildpack for running Java applications using TomEE
Stars: ✭ 12 (-36.84%)
Mutual labels:  buildpack
Heroku Buildpack Nodejs
The official Heroku buildpack for Node.js apps.
Stars: ✭ 1,146 (+5931.58%)
Mutual labels:  heroku-buildpack
custom-ssh-key-buildpack
🔑 Add an SSH key to you Heroku dyno 🔑
Stars: ✭ 49 (+157.89%)
Mutual labels:  buildpack
heroku-buildpack-gradle
This is a Heroku buildpack for Gradle apps. It uses Gradle to build your application and OpenJDK to run it.
Stars: ✭ 58 (+205.26%)
Mutual labels:  buildpack
webpack-rails-buildpack
Buildpack for webpack-rails
Stars: ✭ 19 (+0%)
Mutual labels:  buildpack
swift-buildpack
IBM Cloud buildpack for Swift
Stars: ✭ 33 (+73.68%)
Mutual labels:  buildpack
Heroku Buildpack Google Chrome
Run (headless) Google Chrome on Heroku
Stars: ✭ 215 (+1031.58%)
Mutual labels:  heroku-buildpack
Dokku
A docker-powered PaaS that helps you build and manage the lifecycle of applications
Stars: ✭ 22,155 (+116505.26%)
Mutual labels:  buildpack
heroku-binary-buildpack
Heroku buildpack to execute binaries.
Stars: ✭ 29 (+52.63%)
Mutual labels:  heroku-buildpack
Heroku Buildpack Hugo
Heroku buildpack for Hugo, the static site generator - https://github.com/spf13/hugo
Stars: ✭ 79 (+315.79%)
Mutual labels:  heroku-buildpack
heroku-integrated-firefox-geckodriver
Buildpack enables your client code to access Firefox along with Geckodriver in a Heroku slug.
Stars: ✭ 40 (+110.53%)
Mutual labels:  heroku-buildpack
cloud-native-pipelines
Cloud-native pipelines leveraging Concourse, Pivotal Build Service and Spinnaker to deploy apps
Stars: ✭ 15 (-21.05%)
Mutual labels:  buildpack
heroku-buildpack-d
Heroku Buildpack for the D Programming Language
Stars: ✭ 13 (-31.58%)
Mutual labels:  heroku-buildpack
Zewo
Lightweight library for web server applications in Swift on macOS and Linux powered by coroutines.
Stars: ✭ 1,856 (+9668.42%)
Mutual labels:  buildpack

The Buildpack Standard Library

GitHub tag Build Status Available

This repo contains a standard library for use within Heroku Buildpacks.

It allows for unified output methods, some common buildpack utilities, and facilitates metrics logging.

Usage

In your buildpack, add the following line (towards the top):

source /dev/stdin <<< "$(curl -s --retry 3 https://lang-common.s3.amazonaws.com/buildpack-stdlib/latest/stdlib.sh)"

Or, if you want to pin to a specific release:

source /dev/stdin <<< "$(curl -s --retry 3 https://lang-common.s3.amazonaws.com/buildpack-stdlib/v4/stdlib.sh)"

Or, if you are going to run the code multiple times in your source (e.g. in a utils file that gets sourced multiple times):

if [[ ! -f  /tmp/stdlib-v8.sh ]]; then
  curl --retry 3 -s https://lang-common.s3.amazonaws.com/buildpack-stdlib/v8/stdlib.sh > /tmp/stdlib-v8.sh
fi
source /tmp/stdlib-v8.sh

We recommend pinning to a specific release, for stability reasons.


This will make the following functions available:

Standard output:

  • puts_step, which outputs a build step in a standardized format.
  • puts_error, which outputs a build error in a standarized format.
  • puts_warn, which outputs a build warning in a standardized format.
  • puts_verbose, which outputs a build step if the environment variable BUILDPACK_VERBOSE is set.
  • is_verbose, which returns 0/1, depending on if it's appropriate to use verbose output or not.

Buildpack utilities:

  • set_env, which writes an environment variable to a profile and export script (for multi-buildpack support).
  • set_default_env, which writes a default environment variable to a profile and export script (for multi-buildpack support).
  • un_set_env, which unsets a user-provided environment variable via profile script.
  • sub_env, which launches a subshell with user-provided config.
  • export_env, which exports user-provided config into the current shell.

Metrics (only available to Official Heroku Buildpacks):

  • nowms, which returns the current time in millesconds.
  • mtime, which measures time elapsed for a specific build step.
  • mcount, which logs a count for a specific build step.
  • mmeasure, which logs a measure for specific build step.
  • munique, which logs a unique measurement build step.
  • mcount_exit, which logs an exit event and exits 1.

Please see the contents of stdlib.sh for more usage details (including required environment variables).


Deploying to Amazon S3

Fetch the repo from GitHub:

Upload the stdlib to Amazon S3:

  • $ git remote add heroku https://git.heroku.com/buildpack-stdlib.git
  • $ git push heroku master
  • $ heroku run python upload.py

Notice the version number outputted, then tag it in Git and push that to GitHub:

  • $ git tag v42
  • $ git push --tags

Don't forget to update HISTORY.txt!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].