您将安全环境变量放在before_script
块中,因此 travis 尝试执行它。您可能希望将它们放在env
块中,以及所有其他环境变量中:
language: python
python:
- "2.7"
env:
global:
- DISPLAY=:99.0
- secure: "mbnS2lycZn6/7jKjRf7c5yqQtQXYXBqhzy/FzCuDY9se8t3JxrRL6TUMFZcs\nDl2gJTx6pwjl4DqIUqKkS8tjBdy6zgtq1mDwUrxKwKreIHRo1YPl8hvDDJEz\nnMja/tzVoUA4EFdvyK46srklQHs18S2OKMmMQCa921TAFEOIv5A="
- secure: "iroiS72GhQgKzj7rm+1GoKHkLi4sYXdsdo6Ebe5v6C5lgSBFQ11yWiSQxATt\nxsfzfAF3MyG21lnM/bttUQTP4kJ8DIotLlqmz8+HUYMXZQCZWE9WAfDfDqqJ\nIdeHnet8NuRslJGObkejt/BG8/5Rggbnav9yRhOL3lzeamiVVqY="
matrix:
- DJANGO_VERSION=1.4.1 RACK_ENV=test
before_script:
- "sh -e /etc/init.d/xvfb start"
- sleep 3
- "python manage.py runserver &"
- sleep 5
script:
- "python manage.py test main"
请参阅文档global
以了解与matrix
环境变量之间的区别。