Advertisement
Guest User

Untitled

a guest
May 7th, 2017
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. # Heroku Basic Setup
  2.  
  3. ### Initialize Heroku
  4.  
  5. Assuming Heroku is installed
  6.  
  7. ```
  8. touch Procfile
  9. echo 'web: vendor/bin/heroku-php-apache2 public' > Procfile
  10. ```
  11.  
  12. ```
  13. heroku login
  14. heroku create
  15. heroku buildpacks:set heroku/php
  16. ```
  17.  
  18. ```
  19. heroku config:add APP_ENV=local
  20. heroku config:add APP_DEBUG=true
  21. heroku config:add APP_KEY=...
  22. heroku config:add APP_URL=...
  23. ```
  24.  
  25. ### Add Source Control
  26.  
  27. ```
  28. git init
  29. git add .
  30. git commit -m "Initial commit"
  31. git push heroku master
  32. git remote add origin git@github.com:**********/****.git
  33. git push -u origin master
  34. ```
  35.  
  36. ### Migrations
  37.  
  38. Heroku -> Resources -> Add Heroku Postgres -> Choose the free plan -> Navigate to the Postgres dashboard and copy credentials
  39.  
  40. ```
  41. heroku config:add DB_CONNECTION=pgsql
  42. heroku config:add DB_HOST=...
  43. heroku config:add DB_PORT=...
  44. heroku config:add DB_DATABASE=...
  45. heroku config:add DB_USERNAME=...
  46. heroku config:add DB_PASSWORD=...
  47.  
  48. heroku run php artisan migrate
  49. ```
  50.  
  51. Add the credentials to Postico as well
  52.  
  53. ### Maintencance
  54.  
  55. ```
  56. heroku maintenance:on
  57. heroku maintenance:off
  58. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement