GithubHelp home page GithubHelp logo

finstagram-deployment-guide's Introduction

IMPORTANT

Please do not make any changes directly to your Github EVER. All the work asked of you below must be done form your Gitpod and/or Heroku

Deployment

  1. In the root (What is the root?) of your repository, create the two following files below if they don't already exist:
.gitpod.Dockerfile
.gitpod.yml

Open the above named files from the repo above and add their contents to your gitpod where you created or already had the files of the same name.

  1. Update your Gemfile to match the Gemfile in this repo (the files at the top of this guide)

  2. Update your gitpod config/database.rb file to match the github database.rb file in this repo (the files at the top of this guide)

  3. Copy bundle install into the terminal and run it (press Enter).

  4. Commit the changes, and push to the master branch of the repository by using the following commands in your terminal window. Copy and paste them each individually.

git add .
git commit -m "changes for deployment"
git push origin master

Note: if you receive an error after running git push origin master (access denied), go to the following url:

https://gitpod.io/access-control/

Select the check box "write public repos", press the update button, and re-run git push origin master in your terminal

  1. Now close your Gitpod tabs and access your Gitpod again by using the below url, but be sure to add your username from GitHub into the URL before you press ENTER

The URL/address that you paste into your browser window should match the following pattern: https://gitpod.io/#https://github.com/*[my_github_username_here]*/finstagram ***DELETE THE *[ and ]* when you add in your username

  1. Check that heroku has been properly installed by running the following command in your Gitpod terminal:
heroku --version
  1. Create a heroku account on heroku.com

  2. in the terminal of gitpod, run the following command and log in to heroku with your credentials

heroku login -i
  1. run the following command in the terminal to create the heroku project
heroku create
  1. Access the heroku dashboard with the following url: https://dashboard.heroku.com/apps

  2. Click on the newly created project, select the resources tab, and then under Add-ons, use the search bar to add Heroku Postgres with the free plan

  3. Click on heroku postgres to view the details, under settings tab, click on View Credentials in the row that is for Database Credentials. Copy the URI (should look something like postgres://[some string of text here])

  4. Inside the config/database.rb file, paste the copied URI into the database_url string (line 13)

  5. Run the following commands in your terminal

bundle install
git add .
git commit -m "updated database config"
git push origin master
  1. Push your app live with the following commands
git push heroku
heroku run bundle install
heroku run bundle exec rake db:migrate
  1. In the dashboard of heroku, you can find the link to your app with the button Open App (should be in the top right of the dashboard). After you open your application, you may realize that your posts are missing. This is because the database that we were working with previously was on our Gitpod workspace and now we're using a brand new database on Heroku, which is brand new and doesn't have any data yet.

  2. In order to populate your database with data, create a file in the db directory called seeds.rb ex. db/seeds.rb and fill it in with the values found in the seeds.rb file at the top of this page.

  3. Run the following commands in your terminal to populate your database:

git add .
git commit -m "created seeds file for db"
git push origin master
git push heroku
heroku run bundle exec rake db:seed

Updating the App

If you've made changes to your code, run the following commands in your terminal

git add .
git commit -m "made changes to app"
git push origin master
git push heroku

If you make changes to the database in your Gitpod in the future such as updating posts or adding posts, etc then you must run the following command to update Heroku's database.

heroku run rake db:migrate
  • Deleting all Users; go into tux on your gitpod and type the following command and it'll delete all users. FinstagramPost.where(user_id: 1).destroy_all

Resources

finstagram-deployment-guide's People

Contributors

dru1208 avatar misterhtmlcss avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.