-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b323d71
commit 909aa11
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
######################### | ||
from bottle import default_app, get, post, run | ||
import git | ||
|
||
@post('/secret_url_for_git_hook') | ||
def git_update(): | ||
repo = git.Repo('./mysite') | ||
origin = repo.remotes.origin | ||
repo.create_head('main', origin.refs.main).set_tracking_branch(origin.refs.main).checkout() | ||
origin.pull() | ||
return "" | ||
|
||
|
||
############################## | ||
@get("/") | ||
def _(): | ||
return "One" | ||
|
||
############################## | ||
try: | ||
import production | ||
application = default_app() | ||
except Exception as ex: | ||
print("Running local server") | ||
run(host="127.0.0.1", port=80, debug=True, reloader=True) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
gitpython==3.1.27 | ||
bottle==0.12.23 |