#Pre-requisites
-
Homebrew is installed.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
, it's in PATH,sudo apt-get install build-essential
, andbrew install gcc
. -
virtualenvwrapper is installed(
pip install virtualenvwrapper
) and in PATH.vim ~/.profile
addexport PATH="/home/alison/.local/bin:$PATH"
. Variables below in~/.bashrc
. (Tested under Python 3.8-3.11.)export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 export WORKON_HOME=~/Envs export PROJECT_HOME=~/Sites source /usr/local/bin/virtualenvwrapper.sh
source ~/.bashrc
-
Heroku account
-
Heroku CLI is installed
brew tap heroku/brew && brew install heroku
. You've logged in withheroku login
- Create Repo on Github and pull to local. Open terminal and
cd
to the directory of the repo.cd ~/Sites/PROJECT_NAME
- Create a virtual environment.
mkvirtualenv PROJECT_NAME
Make sure the environment is activated with (PROJECT_NAME) at the beginning of prompt lines. - Add Heroku files and git commit
.Procfile
requiremnts.txt
.gitignore
add or updatemanage.py
runtime.txt
states Python version. Alison local 3.10.12. Heroku default for 3.10 is 3.10.14 as of 5/1/2024. Using 3.10 re: AWS issues/lambda support.app.json
pip install -r requirements.txt
- In Heroku, create a Heroku pipeline.
- Enable Review Apps(development)
- Under Review Apps, create app for development from add an app button (sv-dbt-examp-developmen-r5jfty)
- Under Staging, create app for staging from add an app button (sv-dbt-examples-staging)
- Under Production, create app for production from add an app button (sv-dbt-examples-production)
- In Terminal, make local repo have git remotes to Heroku git repos for each app.
heroku git:remote -a sv-dbt-examp-developmen-r5jfty
git remote rename heroku heroku-development
heroku git:remote -a sv-dbt-examples-staging
git remote rename heroku heroku-staging
heroku git:remote -a sv-dbt-examples-production
git remote rename heroku heroku-production
git remote -v
- Set environment varialbes(Config Vars) in each App(aka environment).
heroku config:set DBT_ENVIRONMENT=dvelopmnt remote
heroku logs --tail --remote heroku-development
then Control+C to close
heroku local --port 5001
then http://localhost:5001/
heroku run python manage.py shell
heroku run bash
heroku addons:create --remote heroku-development heroku-postgresql:essential-0