Skip to content

Instantly share code, notes, and snippets.

@dropwhile
Last active April 5, 2017 23:00
Show Gist options
  • Save dropwhile/e6d2533cd5ba6b1c4d67e4d756fb2bd7 to your computer and use it in GitHub Desktop.
Save dropwhile/e6d2533cd5ba6b1c4d67e4d756fb2bd7 to your computer and use it in GitHub Desktop.
some examples of helper scripts I use: all files go in an ./env dir inside the project (git ignores them due to gitignore match). then you call them like ./env/run.sh
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
alembic "$@"
BREW_PREFIX="$(brew --prefix)"
export CFLAGS="-I${BREW_PREFIX}/include -L${BREW_PREFIX}}/lib"
export ARCHFLAGS="-arch x86_64"
export PYTHONDONTWRITEBYTECODE=1
export PYTHONPATH="${PWD}:${PYTHONPATH}"
export PYTHONHASHSEED=100
export APP_DB_DSN="mysql://root:[email protected]/tabbedout?charset=utf8mb4"
export APP_BI_URL="http://127.0.0.1:81"
export APP_DB_DEBUG="true"
export APP_DEBUG="true"
export APP_SG_DSN="172.16.100.205:4984/db/"
export APP_SG_ADMIN_DSN="http://172.16.100.205:4985/db/"
export APP_COUCHBASE_DSN="couchbase://172.16.100.205/default"
export APP_REDIS_DSN="redis://172.16.100.205:6379/0"
export APP_HMAC_KEY="tests"
export APP_S3_BUCKET="testing-bucket"
export APP_AWS_ENDPOINT="http://172.16.100.205:9000"
export APP_AWS_SECRET_KEY="testing"
export APP_AWS_ACCESS_KEY="testing"
export APP_ENVIRONMENT="dev"
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
make interactive
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
make migrate
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
export APP_HMAC_KEY="some-hmac-key"
export APP_ENVIRONMENT="dev-elij"
make devrun
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
# override db to test db. run w/ debug
export APP_DB_DSN="mysql://root:[email protected]/tabbedout_test?charset=utf8mb4"
export APP_DB_DEBUG="true"
make migrate
#!/bin/bash
source .tox/py27/bin/activate
source env/env.sh
# override db to test db.
export APP_DB_DSN="mysql://root:[email protected]/tabbedout_test?charset=utf8mb4"
py.test --no-cov "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment