Skip to content

My rubbish Deploy script

Zenril edited this page Mar 4, 2019 · 4 revisions

You could just pull the latest version. and run it.

git pull origin master
npm install
node bot.js

but if the bot crashes it wont come back up

SO....

This is the script i'm using to deploy the latest stable version its pretty rubbish :D but gets the job done. https://gist.github.com/zenril/f2ae19f29cd0333f28b05ca520401408

This script assumes

  • Linux
  • Using nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
  • You have the right version of node installed nvm install v8.11.0
  • You have installed forever.js globally
https://www.npmjs.com/package/forever
npm install forever -g
  • You have ffmpeg installed

Setting up..

Getting ready to use the script

  1. Make a talkbot directory somewhere
mkdir ~/talkbot
  1. Clone talkbot into ~/talkbot as app
cd ~/talkbot
git clone [email protected]:wootosmash/talkbot.git app
  1. Copy the config folder from ~/talkbot/app/config - back into a ~/talkbot/shared directory.
mkdir ~/talkbot/shared
cp -r ~/talkbot/app/config ~/talk/shared/

4.Copy ~/talkbot/shared/config/auth.example.json to auth.json

cd ~/talkbot/shared/config
cp auth.example.json auth.json

5.Put your discord Bot token in ~/talkbot/shared/config/auth.json 6.Put your google auth API key in /root/.google/auth.json 7.Put the deploy script in ~/talkbot/deploy

running the deploy script

The following script will

cd ~/talkbot
. deploy start
  1. Deletes the cloned app directory.
  2. Clones a new latest stable version into ./app so run the script from ~/talkbot and it will clone to ~/talkbot/app
  3. Delete ~/talkbot/app/config
  4. Create Symlink from ~/talkbot/shared/config/ to ~/talkbot/app/config
  5. Make sure the correct version of node is running.
  6. npm installs
  7. Runs the app '~/talkbot/app/bot.jswithforever.js` which is a cronjob thing which will restart the bot if it crashes... and it does :D
  8. Logs will be output to ~/talkbot/
Clone this wiki locally