Heroku 上部署的一二事

移除過往資料當中敏感的資訊

Source: https://help.github.com/articles/removing-sensitive-data-from-a-repository/

  • 指令:
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch <PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA>' \
--prune-empty --tag-name-filter cat -- --all
  • <PATH-TO-YOUR-FILE-WITH-SENSITIVE-DATA> 代換成你要取代掉的敏感資料即可,指令會把所有與這個檔案有關的紀錄全部刪除

local 端多條分支,對 heroku 做 git deployment

  • 考量到可能會有敏感資料的問題,所以在 local 端放上這些敏感資料後、開一個新的 branch 來對 heroku 做 deploy

  • Step 1: 建立一個 local 端 branch

git checkout -b release-xx 
  • Step 2: 在這邊補上你的敏感資料(heroku database key etc)

  • Step 3: 使用這個 local 端的 branch 對 heroku 做 deploy,等待指令完成即可完成部署

git add . 
git commit -m "Whatever you want to say"
git push heroku release-xx:master
Select a repo