2016-06-07 92 views
1

我試圖爲我的python 3.5.1/django 1.9.7項目設置一個持續集成管道。在將django應用程序部署到具有codeku的heroku時運行遷移

該項目在heroku上運行良好,只要我的數據庫沒有改變,heroku的代碼管理部署管道工作正常。

如果我想運行遷移,我必須通過在我的計算機上輸入heroku run python manage.py migrate來手動執行遷移操作,我希望避免這種遷移。

我在codeship部署管線中增加了一個「自定義腳本」包含heroku run python manage.py migrate的「Heroku的」 -pipeline後,但是當coedship試圖執行它,它失敗與

Cannot run more than 1 Free size dynos.

消息。我認爲這是因爲服務器已經啓動並運行,並且我沒有更多可用的工作進程? (請糾正我,如果我錯了) 編輯:這是我錯了 - 我有一個額外的進程中運行(參見答案)

有沒有什麼辦法,包括在Heroku的部署數據庫遷移步驟管道?還是我做錯了什麼?

回答

3

Ifound答案在這裏:Heroku: Cannot run more than 1 Free size dynos

我對theweb服務器beeing阻塞賽道的假設是錯誤的,我有一個殭屍進程(createsuperuser)跑我不知道。

我用heroku ps來顯示所有正在運行的程序。輸出是:

=== web (Free): gunicorn my_app.wsgi --log-file - (1) 
web.1: idle 2016/06/07 17:09:06 +0200 (~ 13h ago) 

=== run: one-off processes (1) 
run.7012 (Free): up 2016/06/07 15:19:13 +0200 (~ 15h ago): python manage.py createsuperuser 

我通過鍵入

heroku ps:stop run.7012 

殺害的過程和事後通過codeship自定義腳本我的移民都按預期。

相關問題