-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add Heroku helper scripts #23
base: main
Are you sure you want to change the base?
Conversation
…ion apps in a given team and pipeline.
else | ||
env_file="{{env_file}}" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's verbose, but I think I might like this as a standard pattern for tn-cli scripts. Here this recipe allows you to EITHER pass in your variables from the command line — in this case env_var
and app_name
— OR pass nothing and the script will prompt you for what it needs.
This could help with the documentation issue @oudeismetis brought up in #16. Because the prompts within the script can give users more context on what each variable means.
function set_env() { | ||
echo "Setting env vars from $env_file..." | ||
[ -f "$env_file" ] && grep -vE '^(\s*$|#|DB_|REDIS_|ENVIRONMENT)' "$env_file" | tr '\n' ' ' | xargs heroku config:set -a $app_name || echo "Env file $env_file is not present, unable to set vars." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This departs from the tn-gist version by also protecting against overwriting the ENVIRONMENT
variable on the app, which is set when the app is created.
What This Does
Adds some scripts that help accelerate Heroku setup.
These were already mostly written up in tn-gists, but this should help make them more accessible.
To Do
ALLOWED_HOSTS
?heroku config:set NPM_CONFIG_PRODUCTION=false
sodevDependencies
are installed and the NodeJS build will succeed.