Appearance
Deploying bots
Both the Telegram and Discord bots are run using PM2. However there are other commands needed to deploy these bots. Both bots use the same deployment workflow.
Step 1: Update the EC2 local repos
Be sure the latest updates on from the Github repos are on the EC2 instance. You must have a terminal connection open to the EC2 instance for this step.
sh
# Execute on the EC2 instance
cd ~/api3-telegram-bot
cd git pullStep 2: Update config.json (if needed)
This step is from your local repo. You will send the file to the EC2 repo.
If the config.json file has been updated then send (SCP) the file from your local repo to the EC2 repo. See Keybase for the exact command.
- See the EC2 setup page for the local PEM file setup
- Get the user from Keybase
sh
# Execute on your local machine
cd ~/api3-telegram-bot
scp -i "~/.ssh/id_api3_social_apps.pem" config.json <user>.compute-1.amazonaws.com:api3-telegram-botStep 3: Update prompt.txt (if needed and only for api3-telegram-bot)
This step is from your local repo. You will send the file to the EC2 repo.
If the prompt.txt file has been updated then send (SCP) the file from your local repo to the EC2 repo. See Keybase for the exact command.
- Get the domain from Keybase
sh
# Execute on your local machine
cd ~/api3-telegram-bot
scp -i "~/.ssh/id_api3_social_apps.pem" prompt.txt <user>.compute-1.amazonaws.com:api3-telegram-botStep 4: Start or restart Nodejs
You must have a terminal connection to the EC2 instance for this step.
sh
# Execute on the EC2 instance
cd ~/api3-telegram-bot
pnpm start-prod-pm2
# OR
pnpm restart-prod-pm2Step 5: Check the PM2 console (optional)
Check the PM2 console to see if the Nodejs instance started or restarted properly.
sh
# Execute on the EC2 instance
pnpm monit
OR
pm2 list
