From 52bc20f017927968d81875bc096bc8c7483af515 Mon Sep 17 00:00:00 2001 From: kamo Date: Wed, 29 Jun 2022 13:28:42 +0100 Subject: [PATCH] test sh --- flask_boat.py | 6 +++--- update.sh | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 update.sh diff --git a/flask_boat.py b/flask_boat.py index 770210b..6b57469 100644 --- a/flask_boat.py +++ b/flask_boat.py @@ -122,9 +122,9 @@ def sendStaticFiles(project, filename): @app.route(f'/{base_url}/hook/', methods=['GET', 'POST']) def pull(): if request.method == 'POST': - post_data = json.loads(request.form['payload']) - stream = os.popen('git pull') - output = stream.read() + import subprocess + output = subprocess.call(['sh', '/home/kamo/public_html/update.sh']) + print(output) return output return 'GET method not supported' diff --git a/update.sh b/update.sh new file mode 100644 index 0000000..53dae74 --- /dev/null +++ b/update.sh @@ -0,0 +1,2 @@ +cd /home/kamo/public_html +git pull \ No newline at end of file