4 from datetime import datetime
6 from subprocess import check_call, call, check_output
11 DOC_BASE="/srv/gstreamer.freedesktop.org/public_html/documentation"
13 print(f"Running at {datetime.now()}")
14 with tempfile.TemporaryDirectory() as tmpdir:
17 gl = gitlab.Gitlab("https://gitlab.freedesktop.org/")
18 project = gl.projects.get(1357)
19 pipelines = project.pipelines.list()
20 for pipeline in pipelines:
21 if pipeline.ref != BRANCH:
24 job, = [j for j in pipeline.jobs.list() if j.name == "documentation"]
25 if job.status != "success":
28 url = f"https://gitlab.freedesktop.org/gstreamer/gstreamer/-/jobs/{job.id}/artifacts/download"
29 print("============================================================================================================================")
30 print(f"Updating documentation from: {url}\n\n")
31 check_call(f"wget {url} -O gstdocs.zip", shell=True)
32 print("Unziping file.")
33 check_output("unzip gstdocs.zip", shell=True)
34 print("Running rsync.")
35 call(f"rsync -rvaz --links --delete documentation/ {DOC_BASE}", shell=True)
36 call(f"chmod -R g+w {DOC_BASE}; chgrp -R gstreamer {DOC_BASE}", shell=True)
38 print(f"Done updating doc")