Created
January 16, 2020 12:40
-
-
Save e96031413/0658283ce5f73377a0e8f996189a3141 to your computer and use it in GitHub Desktop.
紀錄Heroku的指令與問題解決方法
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#初始化 | |
$ heroku login #登入heroku | |
$ git init #設定git | |
$ heroku git:remote -a your-app-name #填入在Heroku中設定好的名字 | |
$ heroku config:set DISABLE_COLLECTSTATIC=1 | |
#Push到Heroku | |
$ git add . | |
$ git commit -am "make it better" | |
$ git push heroku master | |
#維護模式 | |
$ heroku maintenance:on #開啟維護模式,其他人無法使用服務,內部可以更新 | |
$ heroku maintenance:off #關閉維護模式,其他人可以使用服務,內部可以更新 | |
$ heroku maintenance #檢查目前維護狀態 | |
#Debug Heroku APP | |
1)先在本地端測試,是不是程式碼的問題 | |
2)Push到Heroku後,到Heroku網站,點擊More→View Logs,透過log來進行Debug | |
#弄壞原本Push的Code怎麼辦? | |
首先,先回到Heroku網站上開啟我們的APP專案頁面,在Activity中,Roll back回正常的版本。 | |
接著,到電腦上開一個全新資料夾(新增資料夾) | |
heroku git:clone -a appNAME | |
git reset --hard c74581c5 #c74581c5是正常運作版,此時會跑到正常的程式碼 | |
git add . | |
git commit -m 'someMesseage' | |
git push heroku master -f #-f參數強制push到master,忽略那些壞掉的版本 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment