|
4 | 4 | span "."
|
5 | 5 | end
|
6 | 6 |
|
7 |
| -step "Commit any pending changes to git" do |
8 |
| - message "Heroku will only receive the files we've committed into our local git repository. So we need to make sure all changed files have been committed." |
9 |
| - console "git status" |
10 |
| - message "`git status` shows you any pending changes you've created. If it has no output, you're already ready to deploy! Otherwise..." |
11 |
| - |
12 |
| - console <<-SHELL |
13 |
| -git add . |
14 |
| -git commit -m "Some helpful message for your future self" |
15 |
| - SHELL |
16 |
| - message "Your commit message should reference whatever your outstanding |
17 |
| -changes are: something like \"Added votes to the topics index\"." |
18 |
| -end |
19 |
| - |
20 |
| -step "Push changes to Heroku" do |
21 |
| - console "git push heroku master" |
22 |
| - message "This takes all changes you've committed locally and pushes them to Heroku." |
23 |
| -end |
24 |
| - |
25 |
| -step "Run database migrations on Heroku" do |
26 |
| - console "heroku run rake db:migrate" |
27 |
| - message "This tells Heroku to run your migrations on its database, like |
28 |
| -running `rake db:migrate` locally." |
29 |
| - message "Heroku's database is separate from the one on your computer, which |
30 |
| -means it needs to be updated every time you make changes to the structure of |
31 |
| -your database." |
32 |
| - message "It also means that you'll not see any of the data you entered into |
33 |
| -the `sqlite3` database on your computer." |
34 |
| -end |
35 |
| - |
36 |
| -step "Visit your application" do |
37 |
| - console "heroku open" |
38 |
| - message "This opens the new application in your browser." |
39 |
| -end |
40 |
| - |
41 |
| -explanation do |
42 |
| - message <<-MARKDOWN |
43 |
| - First, we had to do some work to make Heroku happy with our application. This |
44 |
| -required updating the `Gemfile` and bundling. |
45 |
| - |
46 |
| - * The `Gemfile` is a list of all the Ruby libraries your application needs. |
47 |
| - What we've declared here is that we want to use the `sqlite3` library |
48 |
| - while we're developing on our computer (the development group) but when |
49 |
| - deploying to Heroku (the production group) we want to use the `pg` library, |
50 |
| - which is made for the type of database that Heroku uses. |
51 |
| - |
52 |
| - * Bundler is how Ruby projects keep track of the gems that they use. We told |
53 |
| - Bundler what we wanted to use in the `Gemfile`, now we need to make sure those |
54 |
| - gems are installed. Since we don't have the type of database Heroku does, we |
55 |
| - skip the production gems. Don't worry though! Bundler still logs them so |
56 |
| - Heroku will install them when they get your code. |
57 |
| - MARKDOWN |
58 |
| - |
59 |
| - message "You should be able to deploy your application any time it's in a good, working state. Your typical workflow will look like:" |
60 |
| - img src: "img/workflow.png", alt: "Diagram showing git workflow of making changes, committing them, and pushing to Heroku.", style: "border: none" |
61 |
| - ol do |
62 |
| - li { message "Add or change some code" } |
63 |
| - li { message "Commit your changes (`git commit`)" } |
64 |
| - li { message "(repeat)" } |
65 |
| - end |
66 |
| - message "Any time your changes are committed, you should feel free to `git push heroku master` and boom! Your changes are live!" |
67 |
| -end |
| 7 | +insert '_deploying_to_heroku_again' |
0 commit comments