summaryrefslogtreecommitdiff
path: root/02-update-mirrors.sh
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-07-27 06:56:37 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-07-29 00:44:02 +0100
commitb85f09f4b075e097110c1d9c5070bdc3742d656f (patch)
tree55a4ab0abef2e2ce35c889d31ca5019329d9ca47 /02-update-mirrors.sh
parentd82e31622769571672e24b9620f47b1830aec592 (diff)
ci: Add mirroring script
Provide a mirror job to synchronise libcamera mirrors based on a local configuration file. The file 'libcamera-mirrors' is read one line at a time for remotes to push to. Blank lines and lines prefixed with '#' are ignored. The server running the job must have correct credentials to push to the remote. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to '02-update-mirrors.sh')
-rwxr-xr-x02-update-mirrors.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/02-update-mirrors.sh b/02-update-mirrors.sh
new file mode 100755
index 0000000..350b3c9
--- /dev/null
+++ b/02-update-mirrors.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+source ./common.sh
+
+ID=mirror
+
+LIBCAMERA=${1:-$(srcdir libcamera)}
+
+check_version $LIBCAMERA $ID
+
+echo "Mirroring libcamera at version : " $(libcamera_version "$LIBCAMERA")
+
+sed -e '/#.*/d' -e '/^$/d' libcamera-mirrors | while read remote ;
+do
+ echo "Mirroring to remote : " $remote
+ git -C $LIBCAMERA push $remote master:refs/heads/master
+done
+
+completed $ID