Deploy Slate to Heroku

From : https://abangiya.wordpress.com/2016/12/10/slate-heroku/

Install Slate on Local Computer

  1. Fork lord/slate project to your github repo, then clone to your local computer.

git clone https://github.com/YOURUSERNAME/slate.git

  1. Change directory to slate directory that you just cloned on your local computer.

cd slate

  1. Install all dependencies required to run slate on your local computer.

bundle install

  1. Command above will add vendor folder to your slate directory. Update .gitignore to make this folder ignored everytime you push your Slate project to remote repository.

echo ‘vendor/’ >> .gitignore

  1. Start server on your local.

bundle exec middleman server

If those five commands above successfuly executed, you can see your Slate page live on your browser in http://localhost:4567. At default your Slate project will run on port 4567, if you want your Slate running on different port you can just change set :port value in config.rb.

sed -i ‘s/set :port, 4567/set :port, YOUR_NEW_PORT/g’ config.rb

  1. Add all change to git.

git add .gitignore config.rb or just git add .

  1. Commit that change.

git commit -m "Init project and modify .gitignore (and config.rb if you also do that)"

Deploy to Heroku

Now we move to the next step, deploy your Slate to Heroku.

  1. Login to your heroku account using Heroku CLI in your terminal. Type your email and password.

heroku login

  1. Create heroku app. Modify YOUR_APP_NAME with anything you want your app to be named.

heroku create YOUR_APP_NAME

  1. Create Procfile on your slate directory to determine what command will run by your app’s dynos on the Heroku platform. Read this to get more clear explanation.

echo "web: bundle exec middleman server -p $PORT" > Procfile

  1. Add all change to git (again).

git add Procfile or just git add .

  1. Commit that change.

git commit -m “Add Procfile”

  1. Push your change to Heroku.

git push heroku master

  1. Open your Slate on your browser.

heroku open

Voila, now you can see your Slate live on https://YOUR_APP_NAME.herokuapp.com!

Now you can start build your API Documentation using Slate. Every time you add a new change you can just do git add, git commit, and git push to your heroku repo and see your Slate updated.

© Kimi Tsai all right reserved.            Updated : 2023-07-12 09:04:54

results matching ""

    No results matching ""

    results matching ""

      No results matching ""