-
Notifications
You must be signed in to change notification settings - Fork 0
deployment bot dev
buildsbypat edited this page May 24, 2026
·
1 revision
For a first-time bootstrap on a fresh Debian or Ubuntu host, run:
sudo DEPLOY_USER=deployuser bash deploy/scripts/install-bot-dev.shThat installer:
- installs system packages
- clones the configured branch into
/opt/rob-bot/app - creates the virtual environment
- installs the systemd unit
- creates
/opt/rob-bot/deploy-bot-dev.sh - installs the deploy sudoers entry
- writes a bot
.envtemplate if one does not already exist
- App path:
/opt/rob-bot/app - Service:
rob-bot-dev.service
Use these steps if you are doing the install manually instead of the bootstrap script above.
- Create a runtime user such as
rob. - Clone the repo into
/opt/rob-bot/app. - Copy
.env.exampleto/opt/rob-bot/app/.envand fill the bot values.DISCORD_TOKENis required on the bot server. - Create
.venvand installrequirements.txt. - Copy
deploy/systemd/rob-bot-dev.serviceto/etc/systemd/system/rob-bot-dev.service. - Copy or symlink
deploy/scripts/deploy-bot-dev.shto/opt/rob-bot/deploy-bot-dev.sh. - Enable the service with
sudo systemctl enable --now rob-bot-dev.service. - Verify startup with
PYTHONPATH=. python -m apps.bot.main.
deploy-bot-dev.sh restarts the bot service and reads its status with sudo systemctl ..., so the SSH deploy user should be allowed to run those commands without an interactive password prompt.
Example /etc/sudoers.d/rob-bot-deploy entry:
Cmnd_Alias ROB_BOT_DEPLOY = /bin/systemctl restart rob-bot-dev.service, /usr/bin/systemctl restart rob-bot-dev.service, /bin/systemctl --no-pager --full status rob-bot-dev.service, /usr/bin/systemctl --no-pager --full status rob-bot-dev.service
deployuser ALL=(root) NOPASSWD: ROB_BOT_DEPLOY
Add these secrets:
BOT_DEV_HOSTBOT_DEV_USERBOT_DEV_SSH_KEYBOT_DEV_PORT
Then run the manual workflow Deploy Bot Dev.