Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install on a droplet #3

Closed
chadwhitacre opened this issue Mar 1, 2016 · 15 comments
Closed

install on a droplet #3

chadwhitacre opened this issue Mar 1, 2016 · 15 comments

Comments

@chadwhitacre
Copy link
Contributor

We now have a script to rotate the radar. Let's deploy it!

I'm thinking we can spin up another droplet at Digital Ocean for this, and use cron.

@chadwhitacre
Copy link
Contributor Author

I wrote a script to kick off payday. My hope and dream is to run it under cron at Digital Ocean tomorrow.

@chadwhitacre
Copy link
Contributor Author

I've spun up a droplet. I need to configure keys so I can access it.

@chadwhitacre
Copy link
Contributor Author

Progress!

Mar  3 11:47:01 bot CRON[10832]: (root) CMD (/root/bot/update.sh | logger -t bot)
Mar  3 11:47:01 bot bot: Up-to-date

Mar  3 11:48:01 bot CRON[10913]: (root) CMD (/root/bot/update.sh | logger -t bot)
Mar  3 11:48:01 bot bot: Updating ...
Mar  3 11:48:03 bot bot: Updating 4e36d47..96fb7b5
Mar  3 11:48:03 bot bot: Fast-forward
Mar  3 11:48:03 bot bot:  README.md | 3 +--
Mar  3 11:48:03 bot bot:  crontab   | 6 +++---
Mar  3 11:48:03 bot bot:  update.sh | 3 ++-
Mar  3 11:48:03 bot bot:  3 files changed, 6 insertions(+), 6 deletions(-)
Mar  3 11:48:03 bot bot: Requirement already up-to-date: requests==2.9.1 in ./env/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Mar  3 11:48:03 bot crontab[10955]: (root) REPLACE (root)

Mar  3 11:49:01 bot CRON[10957]: (root) CMD (/root/bot/update.sh | logger -t UPDATE-BOT)

@chadwhitacre
Copy link
Contributor Author

Now I need to configure environment variables and I'm ready to test out payday!

@chadwhitacre
Copy link
Contributor Author

Mar  3 12:20:01 bot CRON[11578]: (root) CMD ($PYTHON /root/bot/kick-off-payday.py 2>&1 | logger -t KICK-OFF-PAYDAY)
Mar  3 12:20:01 bot CRON[11579]: (root) CMD ($PYTHON /root/bot/rotate-radar.py 2>&1 | logger -t ROTATE-RADAR)
Mar  3 12:20:01 bot CRON[11580]: (root) CMD (/root/bot/update.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 12:20:03 bot ROTATE-RADAR: created https://github.com/gratipay-bot/test/issues/10
Mar  3 12:20:03 bot ROTATE-RADAR: closed https://github.com/gratipay-bot/test/issues/4
Mar  3 12:20:03 bot KICK-OFF-PAYDAY: created https://github.com/gratipay-bot/test/issues/11

😳

@chadwhitacre
Copy link
Contributor Author

Blam!

screen shot 2016-03-03 at 12 21 04 pm
screen shot 2016-03-03 at 12 21 12 pm

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

Okay! I'm about ready to aim this at gratipay/inside.gratipay.com.

@chadwhitacre
Copy link
Contributor Author

Alright! So what are the steps here? I've made sure that the tickets have the content we want to be copied over to the new tickets. Here's my plan:

  • take out the testing cron jobs—done in 40a6df0
  • redeploy to make sure README is right
  • modify the configuration
  • modify cron to run payday now—done in 8f5243f and 3165f4c
  • watch @gratipay-bot kick off payday!
  • modify cron to run payday Thursday early—done in 903b68a

@chadwhitacre
Copy link
Contributor Author

root@bot:~/bot# tail -f /var/log/syslog
Mar  3 13:42:01 bot CRON[2918]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:42:02 bot UPDATE-BOT: From https://github.com/gratipay/bot
Mar  3 13:42:02 bot UPDATE-BOT:    cc4e14b..8f5243f  master     -> origin/master
Mar  3 13:42:02 bot UPDATE-BOT: Here we go!
Mar  3 13:42:02 bot UPDATE-BOT: Updating cc4e14b..8f5243f
Mar  3 13:42:02 bot UPDATE-BOT: Fast-forward
Mar  3 13:42:02 bot UPDATE-BOT:  crontab | 2 +-
Mar  3 13:42:02 bot UPDATE-BOT:  1 file changed, 1 insertion(+), 1 deletion(-)
Mar  3 13:42:03 bot UPDATE-BOT: Requirement already up-to-date: requests==2.9.1 in ./env/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Mar  3 13:42:03 bot crontab[2972]: (root) REPLACE (root)


Mar  3 13:43:01 bot cron[918]: (root) RELOAD (crontabs/root)
Mar  3 13:43:01 bot CRON[2977]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:44:01 bot CRON[2990]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:45:01 bot CRON[3004]: (root) CMD ($PYTHON /root/bot/kick-off-payday.py 2>&1 | logger -t KICK-OFF-PAYDAY)
Mar  3 13:45:01 bot CRON[3005]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:45:02 bot KICK-OFF-PAYDAY: Traceback (most recent call last):
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:   File "/root/bot/kick-off-payday.py", line 43, in <module>
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:     main()
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:   File "/root/bot/kick-off-payday.py", line 38, in main
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:     previous = paydays.find_previous()
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:   File "/root/bot/kick-off-payday.py", line 11, in find_previous
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:     return self.hit_api('get', params={'state': 'all', 'labels': 'Payday'})[0]
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:   File "/root/bot/botlib.py", line 37, in hit_api
Mar  3 13:45:02 bot KICK-OFF-PAYDAY:     raise APIError(response.status_code, response.text)
Mar  3 13:45:02 bot KICK-OFF-PAYDAY: botlib.APIError: <APIError 404: {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}>

@chadwhitacre
Copy link
Contributor Author

Indeed, I had GITHUB_REPO wrong (gratipay-bot/inside.gratipay.com instead of gratipay/inside.gratipay.com). Fixed now, modifying crontab again ...

@chadwhitacre
Copy link
Contributor Author

Picked up the new crontab:

Mar  3 13:46:01 bot CRON[3021]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:47:01 bot CRON[3106]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:48:02 bot CRON[3121]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:48:02 bot UPDATE-BOT: From https://github.com/gratipay/bot
Mar  3 13:48:02 bot UPDATE-BOT:    8f5243f..3165f4c  master     -> origin/master
Mar  3 13:48:02 bot UPDATE-BOT: Here we go!
Mar  3 13:48:03 bot UPDATE-BOT: Updating 8f5243f..3165f4c
Mar  3 13:48:03 bot UPDATE-BOT: Fast-forward
Mar  3 13:48:03 bot UPDATE-BOT:  crontab | 2 +-
Mar  3 13:48:03 bot UPDATE-BOT:  1 file changed, 1 insertion(+), 1 deletion(-)
Mar  3 13:48:03 bot UPDATE-BOT: Requirement already up-to-date: requests==2.9.1 in ./env/lib/python3.4/site-packages (from -r requirements.txt (line 1))
Mar  3 13:48:03 bot crontab[3174]: (root) REPLACE (root)

@chadwhitacre
Copy link
Contributor Author


Mar  3 13:50:01 bot CRON[3190]: (root) CMD ($PYTHON /root/bot/kick-off-payday.py 2>&1 | logger -t KICK-OFF-PAYDAY)
Mar  3 13:50:01 bot CRON[3191]: (root) CMD (/root/bot/update-if-needed.sh 2>&1 | logger -t UPDATE-BOT)
Mar  3 13:50:03 bot KICK-OFF-PAYDAY: created https://github.com/gratipay/inside.gratipay.com/issues/526

😳

@chadwhitacre
Copy link
Contributor Author

@chadwhitacre
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant