Some checks failed
Gitea Actions Demo Training / Explore-Gitea-Actions (push) Failing after 14s
29 lines
843 B
Python
29 lines
843 B
Python
import time
|
|
import os
|
|
import webhook_listener
|
|
|
|
def process_post_request(request, *args, **kwargs):
|
|
print(
|
|
"Received request:\n"
|
|
+ "Method: {}\n".format(request.method)
|
|
+ "Headers: {}\n".format(request.headers)
|
|
+ "Args (url path): {}\n".format(args)
|
|
+ "Keyword Args (url parameters): {}\n".format(kwargs)
|
|
# + "Body: {}".format(
|
|
# request.body.read(int(request.headers["Content-Length"]))
|
|
# if int(request.headers.get("Content-Length", 0)) > 0
|
|
# else ""
|
|
# )
|
|
)
|
|
# Process request here
|
|
os.system('git pull')
|
|
os.system('cd ../slides; ./build.sh once')
|
|
return
|
|
|
|
webhooks = webhook_listener.Listener(handlers={"POST": process_post_request},logScreen=False)
|
|
webhooks.start()
|
|
|
|
while True:
|
|
print("Still alive....")
|
|
time.sleep(300)
|