From 563af194c5144f0b915135ba8d8174a2991bca6f Mon Sep 17 00:00:00 2001 From: jaskaranSM Date: Tue, 29 Oct 2019 19:42:39 +0530 Subject: [PATCH] Added Guide for Deploying on Heroku --- README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c099a5e..f000355 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ pip3 install -r requirements.txt - Install aria2 For Debian based distros ``` -sudo apt install aria2c +sudo apt install aria2 ``` - For Arch and it's derivatives: ``` @@ -71,4 +71,46 @@ Fill up rest of the fields. Meaning of each fields are discussed below: python3 -m bot ``` -Note: You can limit maximum concurrent downloads by changing the value of MAX_CONCURRENT_DOWNLOADS in aria.sh. By default, it's set to 2 \ No newline at end of file +Note: You can limit maximum concurrent downloads by changing the value of MAX_CONCURRENT_DOWNLOADS in aria.sh. By default, it's set to 2 + +#Deploying on Heroku +- First Run Bot locally on your computer i.e: Do above steps and get G-Drive Token File( token.pickle ) +- Change Bot Download Dir to /bot/downloads in config.ini file. +- Install [Heroku cli](https://devcenter.heroku.com/articles/heroku-cli) +- Login into your heroku account with command: +``` +heroku login +``` +- Create a new heroku app: +``` +heroku create appname +``` +- Select This App in your Heroku-cli: +``` +heroku git:remote -a appname +``` +- Change Dyno Stack to a Docker Container: +``` +heroku stack:set container +``` +- Add Private Credentials and Config Stuff: +``` +git add -f credentials.json token.pickle ./bot/config.ini +``` +- Commit new changes: +``` +git commit -m "Added Creds." +``` +- Push Code to Heroku: +``` +git push heroku master --force +``` +- Restart Worker by these commands: +``` +heroku ps:scale worker=0 +``` +``` +heroku ps:scale worker=1 +``` + +Heroku-Note: Doing authorizations ( /authorize command ) through telegram wont be permanent as heroku uses ephemeral filesystem. They will be reset on each dyno boot.