sympy / planet-sympy

The planet SymPy sources

Home Page:https://planet.sympy.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pass in the DEPLOY_TOKEN as a runtime variable

certik opened this issue · comments

Currently one must set the DEPLOY_TOKEN by hand in the crontab file and rebuild the image. A better way is to set the DEPLOY_TOKEN at runtime like this:

docker run -d -e DEPLOY_TOKEN=XXX test/planet-sympy:v1

But for some reason, the ./update.sh script only sees this variable when executed from the user directly, but does not see it when executed via cron.

Essentially the problem is that environment variables are not passed into the cron jobs. Here is a nice and simple solution:

http://stackoverflow.com/a/29790710/479532

Also, we should run cron as a user. That might fix the environment variables as well. So in order to fix this issue, let's first figure out how to run cron as a user.

Looks like it's hard to get cron working as a user. I think we should rather use this solution:

https://github.com/dbader/schedule

Then it runs as a user, and it's clear what it does. It should also see the environment variables by default.

Fixed in #21.