Skip to content

Instantly share code, notes, and snippets.

@crcastle
Last active January 3, 2017 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crcastle/f6f5c16ced72046b83575029aeb499c6 to your computer and use it in GitHub Desktop.
Save crcastle/f6f5c16ced72046b83575029aeb499c6 to your computer and use it in GitHub Desktop.
Heroku Fast Demo Create App and Deploy
mkdir my-app
cd my-app
echo "Hello World!" > index.php
git init
git add .
git commit -m 'Initial commit for new app'
heroku create
git push heroku master
heroku open
# use accessibility zoom with ctrl+scroll to zoom in on small "Hello World!" text
# say "For real applications we would add a database and other add-ons of course
heroku addons:create heroku-postgresql
# Scale up!
# make sure you create this app in a Heroku Team or Org so that you can scale up your app without having to first change the dyno type
# you can specify the team or org in which the app is created in by preceding the heroku create command with `export HEROKU_ORGANIZATION=dev-rel`
# replace dev-rel with any team or org name you have access to
heroku logs -t #optionally show this in a split pane while you scale up to show 99 dynos starting up
heroku ps:scale web=100
# Now make a change and deploy to all 100 dynos
# Edit index.php to replace "Hello World!" with "<h1>Hello World!</h1>"
git add .
git commit -m 'Make text bigger'
git push heroku master
heroku open
# We just updated 100 dynos! So fast!
# Scale down
heroku ps:scale web=1
# Show how cheap it was to run 100 dynos for 5 minutes using Spotlight calculator or Alfred or Google
# ($25/month / (30 days * 24 hours * 60 minutes)) * 5 minutes * 100 dynos = approx $0.29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment