Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify labels unique to a process type #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@ Test http://myendpoint.com.

For more information on setting up backplane see `backplane help`.

### Multiple web server process types

In order to route traffic to the correct dynos you can apply unique labels to a process type
by using the `BACKPLANE_LABELS_<proc>` environment variable. Only the backplane agents running
on dynos for the `<proc>` process type will apply these labels. Note: the labels from
`BACKPLANE_LABELS` will also be applied universally across all whitelisted process types.

Example:

$ heroku config:set BACKPLANE_LABELS_externalweb="endpoint=external.myendpoint.com"

## Known Issues

### Fetch Error
Expand Down
10 changes: 10 additions & 0 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,18 @@ install_backplane() {

install_backplane

echo "-----> Backplane Agent sources labels from the enviroment varaible BACKPLANE_LABELS by default."
echo " Add unique labels for each process listed in the Procfile using BACKPLANE_LABELS_<proc>."
echo " Example: BACKPLANE_LABELS_web=\"endpoint=www.mydomain.com\""

echo "-----> Writing .profile.d/backplane.sh"
cat <<-EOF > $build/.profile.d/backplane.sh
CURRENT_PROCESS_TYPE=\${DYNO%.*}
BACKPLANE_LABELS_proc=BACKPLANE_LABELS_\${CURRENT_PROCESS_TYPE}
if [ -n \${!BACKPLANE_LABELS_proc+x} ]; then
BACKPLANE_LABELS="\$BACKPLANE_LABELS, \${!BACKPLANE_LABELS_proc}"
fi

BACKPLANE_LABELS="\$BACKPLANE_LABELS, heroku=true"
\$HOME/bin/backplane connect "\$BACKPLANE_LABELS" http://127.0.0.1:\$PORT &
EOF