วิธีการ Deploy - MUMT-IT/mis2018 GitHub Wiki

How to deploy to the test and production server.

Add a remote server.

Production server

$ git remote add heroku_prod https://git.heroku.com/mumtmis.git;

Test server

$ git remote add heroku_test https://git.heroku.com/mumtmis-test-only.git;

Check if the remote is available.

$ git remote -v;

Update the branch from the remote repo. (optional)

$ git fetch upstream master
$ git merge upstream/master

Check if there is any fork in database migration.

$ flask db heads

Merge heads (if any) and upgrade to test the merge.

$ flask db merge heads
$ flask db upgrade

Commit the database version.

$ git add migrations/versions/....py
$ git commit -m 'merged database heads'

Push to the test server.

$ git push heroku_test master;

Update the database on the server.

$ heroku run flask db upgrade --remote heroku_test