Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigurdmazanti committed Mar 3, 2024
1 parent b323d71 commit 909aa11
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
25 changes: 25 additions & 0 deletions app.py
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)
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gitpython==3.1.27
bottle==0.12.23

0 comments on commit 909aa11

Please sign in to comment.