udpsrc: GstSocketTimestampMessage only for SCM_TIMESTAMPNS
[platform/upstream/gstreamer.git] / ci / gitlab / freedesktop_doc_importer.py
1 #!/usr/bin/python3
2 import os
3 import gitlab
4 from datetime import datetime
5 import tempfile
6 from subprocess import check_call, call, check_output
7
8 BRANCH="main"
9 NAMESPACE="gstreamer"
10 JOB="documentation"
11 DOC_BASE="/srv/gstreamer.freedesktop.org/public_html/documentation"
12
13 print(f"Running at {datetime.now()}")
14 with tempfile.TemporaryDirectory() as tmpdir:
15     os.chdir(tmpdir)
16
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:
22             continue
23
24         job, = [j for j in pipeline.jobs.list() if j.name == "documentation"]
25         if job.status != "success":
26             continue
27
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)
37
38         print(f"Done updating doc")
39         break