diff options
| author | Arslaan Pathan <[email protected]> | 2026-10-06 13:51:24 +1300 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-10-06 13:51:24 +1300 |
| commit | 9935b1c6a0e0845f724a9c495caf01977ee81fbb (patch) | |
| tree | f419bc30316d698b703e81ca0b032b4e171510b2 /backend.py | |
| parent | 36e061f9db1a7b99c19bcebd960e47c42616e6c3 (diff) | |
| download | remote-automation-9935b1c6a0e0845f724a9c495caf01977ee81fbb.tar.xz remote-automation-9935b1c6a0e0845f724a9c495caf01977ee81fbb.zip | |
website deploy button
Diffstat (limited to 'backend.py')
| -rw-r--r-- | backend.py | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -183,5 +183,32 @@ def fav_song(): "artist": "Oxlo" } [email protected]("/automate/zola") +def zola(): + result = subprocess.run( + [ + "sh", "-c", + "cd /srv/www/_src-v3 && " + "git pull && " + "~/.cargo/bin/zola build -o /srv/www/_site-v3 -f" + ], + capture_output=True, + text=True, + ) + + if result.returncode != 0: + print(result.stdout) + print(result.stderr) + return "deployment failed", 500 + + subprocess.Popen([ + "mpv", + "--no-video", + "--audio-device=pipewire", + "/srv/shares/public/Media/done.mp3", + ]) + + return "ok" + if __name__ == "__main__": app.run(host="0.0.0.0", port=6732) |
