You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bee has a deploy script -- deploy.sh here in the beebrain repo -- for Beebrain but it needs robusted up and generalized so people besides her can actually use it.
Currently it assumes her personal aliases for the servers and probably other such junk. So it's sort of rudimentary but with minimal modification can be run by anyone with beeminder-user access to servers.
Here's how deploys happen currently:
Danny or Uluc (or an open source contributor!) says "check out the new hotness in the beebrain repo"
Danny uses Automon to convince himself it doesn't break things
Danny updates the version number at the top of package.json and merges/pushes to master
Danny asks Bee to deploy what's in the master branch of the beebrain (aka road) repo to production
Bee runs ./deploy.sh
Danny does "import from GitHub" on road.glitch.me and occasionally road-staging.glitch.me
I started a deploy script, but i'm not so very smart at bash scripting, so I haven't figured out how to do all the things via ssh or using bash commands or whatever. Here is what I do:
date=`date +%Y%m%d_%H%M`
server=fshr # i have named entries for each of the servers in my ssh config; fshr, germ, hop
# 1. open up the jsbrain logs in a different terminal (there's actually a
# detached screen under the beeminder account on each server that's named
# jsbrain, which is running `pm2 logs jsbrain`, so the following just connects
# to that screen):
ssc beeminder@$server jsbrain
# 2. make a fallback branch in jsbrain dir using timestamp
ssh beeminder@$server "cd /var/www/jsbrain; git branch $date"
# blist=`ssh beeminder@$server 'cd /var/www/jsbrain; git branch'`
# 3. only keep the last 8 checkpoints
ssh beeminder@$server
cd /var/www/jsbrain/
git branch # lists all the branches
git branch -D $oldestbranch
# 4. gently stop resque
ssh beeminder@$server
sudo god stop resque
# this does not actually do a gentle stop, i think we have to do something to
# our resque config or something to get it to respond gently? anyhow, so I watch
# the resque queues until they're empty, or i just go visit resque web and
# requeue anything that gets killed by this.
# 5. check that it's all quiesced
# Look at the tail of the jsbrain logs. Is it quiet now? It should be because there
# should no longer be any workers on this server sending stuff to this jsbrain instance
# 7. git pull
ssh beeminder@$server
cd /var/www/jsbrain/
git pull
# 8. cd jsbrain_server
cd jsbrain_server
# 9. npm install
npm install
# 10. reload jsbrain
pm2 reload jsbrain
# 11. restart god
sudo god start resque
# 12. look at the jsbrain logs again and see that they are starting up again and
# getting new jobs and there aren't any errors.
# 13. repeat for the other 2 servers.
Desiderata
Bee has a deploy script -- deploy.sh here in the beebrain repo -- for Beebrain but it needs robusted up and generalized so people besides her can actually use it.
Currently it assumes her personal aliases for the servers and probably other such junk. So it's sort of rudimentary but with minimal modification can be run by anyone with beeminder-user access to servers.
Here's how deploys happen currently:
./deploy.sh
Cognata
Verbata: deploy scripts, infrastructure, deploying beebrain, beebody adjacent, web hosting,
The text was updated successfully, but these errors were encountered: