- job:
    name: linux-shallow-clone

    description: |
      Update shallow clones of linux.git branches that are relevant for our CI
      jobs. Other jobs can then quickly clone a branch from this git repository
      and discard it afterwards. This saves disk space on our jenkins nodes,
      and keeps the traffic to git.kernel.org minimal.

    concurrent: false

    project-type: matrix
    axes:
      - axis:
          type: slave
          name: label
          values:
            - build4-deb12build-ansible
            - build5-deb12build-ansible

    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 120

    parameters:
      - string:
          name: BRANCH
          description: |
                osmo-ci.git branch
          default: 'master'
      - string:
          name: EMAIL_NOTIFICATIONS
          description: For failed build notifications, set to empty to disable
          default: 'jenkins-notifications@lists.osmocom.org'

    scm:
      - git:
          url: https://gerrit.osmocom.org/osmo-ci
          git-config-name: 'Jenkins Builder'
          git-config-email: 'jenkins@osmocom.org'
          skip-tag: true
          branches:
            - '$BRANCH'
          wipe-workspace: true

    triggers:
      - timed: "H H * * *"

    builders:
      - shell: 'scripts/kernel/linux-shallow-clone.sh ~/linux.git'

    wrappers:
    - ansicolor:
        colormap: xterm

    publishers:
      - email:
          recipients: '$EMAIL_NOTIFICATIONS'
