feat: cwd in deployer

This commit is contained in:
Pavel Korytov 2021-11-26 19:40:34 +03:00
parent a287df963a
commit b4f8cb4567

View file

@ -19,7 +19,12 @@ def create_app():
@app.route('/', methods=['POST']) @app.route('/', methods=['POST'])
@auth.login_required @auth.login_required
def deploy(): def deploy():
subprocess.run(['git', 'fetch', 'origin']) subprocess.run(
subprocess.run(['git', 'checkout', 'origin/gh-pages']) ['git', 'fetch', 'origin'], cwd=os.environ.get('CWD', None)
)
subprocess.run(
['git', 'checkout', 'origin/gh-pages'],
cwd=os.environ.get('CWD', None)
)
return app return app