在我的 Jenkins 构建中,最后一步是推送到 heroku 并运行数据库迁移。 git Push 工作正常,并且应用程序已部署,但我在运行数据库迁移时遇到问题。以下是 Jenkins 的控制台输出。
+ heroku run rake db:migrate --app myapp
Running rake db:migrate attached to terminal... stty: standard input: Invalid argument
up, run.6
stty: standard input: Invalid argument
如果我从服务器运行与 jenkins 用户相同的命令,它工作正常。我仅在自动构建过程中收到错误。
作为背景,这是一个在 Heroku Cedar 上运行的 Rails 3.1 应用程序。
最佳答案
我可以通过重定向输出来解决这个问题。
heroku run rake db:migrate --app myapp > rake.log
cat rake.log
关于heroku - 运行heroku rake db :migrate from a Jenkins build fails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7575295/