From da1f9ebbf82101966aff938ec3eb1e987bf818c7 Mon Sep 17 00:00:00 2001 From: Ed Morley Date: Fri, 1 Sep 2017 17:23:44 +0100 Subject: [PATCH] Bug 1394593 - Heroku: Use .profile instead of set-env set-env was renamed in the buildpack to set_env, breaking this script. Rather than just renaming our usage, it makes more sense to stop using what is really an internal buildpack API and instead use `.profile`: https://devcenter.heroku.com/articles/dynos#the-profile-file --- bin/post_compile | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/post_compile b/bin/post_compile index b628634bc..747f8b921 100755 --- a/bin/post_compile +++ b/bin/post_compile @@ -14,19 +14,15 @@ yarn build # collectstatic, and so does not affect files in the `dist/` directory. python -m whitenoise.compress dist -# The post_compile script is run in a sub-shell, so we need to source the -# buildpack's utils script again, so we can use set-env/set-default-env: -# https://github.com/heroku/heroku-buildpack-python/blob/master/bin/utils -source $BIN_DIR/utils - # Add environment variables to the profile script run on Dyno startup. +# https://devcenter.heroku.com/articles/dynos#the-profile-file # Only variables that are rarely changed and not site-specific should # be set here. Set everything else using Heroku's CLI / dashboard. -# Override the hostname that is displayed in New Relic, so the Dyno name -# (eg "web.1") is shown, rather than "Dynamic Hostname". $DYNO is quoted -# so that it's expanded at runtime on each dyno, rather than now. -set-env NEW_RELIC_PROCESS_HOST_DISPLAY_NAME '$DYNO' +# Override the hostname displayed in New Relic, so the Dyno name (eg "web.1") +# is shown, rather than "Dynamic Hostname". Single quotes are used to so that +# `$DYNO` is expanded at app runtime, rather than now. +echo 'export NEW_RELIC_PROCESS_HOST_DISPLAY_NAME="${DYNO}"' >> .profile # Remove nodejs files to reduce slug size (and avoid environment variable # pollution from the nodejs profile script), since they are no longer