---
- project:
    name: registry-update-base-images
    jobs:
      - registry-update-base-images

- job:
    name: registry-update-base-images
    description: |
        Update base docker images in our private registry.osmocom.org with those from docker.io
        Related:<br>
        <ul>
          <li> <a href="https://osmocom.org/issues/4839">OS#4839</a>
        </ul>
    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 30
    parameters:
      - string:
          name: EMAIL_NOTIFICATIONS
          description: For failed build notifications, set to empty to disable
          default: 'jenkins-notifications@lists.osmocom.org'
    node: osmocom-master
    builders:
      - shell: |
          REGISTRY="registry.osmocom.org"
          IMAGES="
            debian/eol:buster
            debian:bullseye
            debian:bookworm
            debian:trixie
            debian:sid

            centos:centos7
          "
          for i in $IMAGES; do
            src=$i
            dst=$REGISTRY/$i
            echo
            echo ======= $src
            docker pull $src
            docker tag $src $dst
            docker push $dst
          done
    triggers:
      - timed: "H 00 * * *"

    publishers:
      - email:
          notify-every-unstable-build: true
          recipients: '$EMAIL_NOTIFICATIONS'

# vim: expandtab tabstop=2 shiftwidth=2
