initial commit

This commit is contained in:
mwiegand 2021-11-14 21:05:32 +01:00
commit 081fc9c3c3
2 changed files with 28 additions and 0 deletions

22
build_server/__init__.py Normal file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env python3
from flask import Flask, request
from functools import cache
from subprocess import check_output
import json
app = Flask(__name__)
app.secret_key = environ.get("FLASK_SECRET_KEY", default='test')
@app.route('/', methods = ['GET'])
def build():
strategy = request.args.get('strategy')
hook_data = request.get_json()
print(hook_data)
return check_output([f'/opt/build_server/strategies/{strategy}', json.dumps(hook_data)])
if __name__ =='__main__':
app.run(host='0.0.0.0')

6
setup.py Normal file
View file

@ -0,0 +1,6 @@
from setuptools import find_packages, setup
setup(
name="build_server",
packages=find_packages(),
)