]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
Add sync-images job 2208/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 28 Feb 2024 10:17:22 +0000 (11:17 +0100)
committerGuillaume Abrioux <gabrioux@ibm.com>
Thu, 29 Feb 2024 09:19:27 +0000 (10:19 +0100)
This adds a nightly job in order to mirror some container
images (grafana image only for now) from docker.io to quay.io

Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
sync-images/build/build [new file with mode: 0644]
sync-images/build/sync.yml [new file with mode: 0644]
sync-images/config/JENKINS_URL [new file with mode: 0644]
sync-images/config/definitions/sync-images.yml [new file with mode: 0644]

diff --git a/sync-images/build/build b/sync-images/build/build
new file mode 100644 (file)
index 0000000..4ef3b6c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/bash
+set -e
+
+# shellcheck disable=SC2034
+WORKDIR=$(mktemp -td tox.XXXXXXXXXX)
+
+podman run --rm -v ./sync.yml:/sync.yml quay.io/skopeo/stable sync --src yaml --dest docker /sync.yml "${DEST_REGISTRY}" --dest-username "${DEST_USERNAME}" --dest-password "${DEST_PASSWORD}"
diff --git a/sync-images/build/sync.yml b/sync-images/build/sync.yml
new file mode 100644 (file)
index 0000000..b6a471a
--- /dev/null
@@ -0,0 +1,3 @@
+docker.io:
+  images-by-tag-regex:
+    grafana/grafana: ^(9\.?|[0-9]{2,}\.?)([0-9]*\.?){1,}$
diff --git a/sync-images/config/JENKINS_URL b/sync-images/config/JENKINS_URL
new file mode 100644 (file)
index 0000000..e8f5e81
--- /dev/null
@@ -0,0 +1 @@
+jenkins.ceph.com
diff --git a/sync-images/config/definitions/sync-images.yml b/sync-images/config/definitions/sync-images.yml
new file mode 100644 (file)
index 0000000..4b048fb
--- /dev/null
@@ -0,0 +1,41 @@
+- job:
+    name: sync-images
+    id: sync-images
+    node: small && centos8
+    defaults: global
+    display-name: sync-images
+    quiet-period: 5
+    block-downstream: false
+    block-upstream: false
+    retry-count: 3
+    properties:
+      - build-discarder:
+          days-to-keep: -1
+          num-to-keep: -1
+          artifact-days-to-keep: -1
+          artifact-num-to-keep: -1
+
+    triggers:
+      - timed: '@daily'
+
+    parameters:
+      - string:
+          name: DEST_REGISTRY
+          description: "The destination registry hostname. Eg: quay.io"
+          default: "quay.io/ceph"
+
+    builders:
+      - shell:
+          !include-raw-escape:
+            - ../../../scripts/build_utils.sh
+            - ../../build/build
+
+    wrappers:
+      - inject-passwords:
+          global: true
+          mask-password-params: true
+      - credentials-binding:
+          - username-password-separated:
+              credential-id: sync-images-from-docker-to-quay
+              username: DEST_USERNAME
+              password: DEST_PASSWORD
\ No newline at end of file