- project:
    name: master-builds-dahdi-linux
    linux-repo-branch:
      - "torvalds-master"
      - "stable-linux-4.19.y"
      - "stable-linux-5.10.y"
      - "stable-linux-6.1.y"
      - "stable-linux-6.12.y"
      - "stable-linux-rolling-stable"
    jobs:
      - 'master-dahdi-linux-{linux-repo-branch}'

- job-template:
    name: 'master-dahdi-linux-{linux-repo-branch}'
    project-type: freestyle
    node: linux-shallow-clone
    concurrent: true
    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 120
    description: |
      Automatic jenkins test job of
      <a href="https://gerrit.osmocom.org/#/q/status:open+project:dahdi-linux">dahdi-linux</a>
      built against linux {linux-repo-branch}
      (<a href="https://osmocom.org/issues/5407">OS#5407</a>)
      <br/><br/>
      <b>Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY!</b>

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

    scm:
      - git:
         url: 'https://gerrit.osmocom.org/dahdi-linux'
         branches:
           - '$BRANCH'
         wipe-workspace: true

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

    builders:
      - shell: |
          docker run \
            --rm=true \
            -e "KSRC=/linux" \
            -v "$PWD:/build" \
            -v "$HOME/linux.git:/linux.git:ro" \
            "$USER/debian-bookworm-build" \
            sh -e -x -c "
              git config --global --add safe.directory /linux.git
              git -C /linux.git -c color.ui=always log -1 --oneline {linux-repo-branch}
              git clone -q /linux.git -b {linux-repo-branch} /linux
              chown -R build:build /linux
              timeout 10m su build -c /build/contrib/jenkins.sh
            "

    wrappers:
    - ansicolor:
        colormap: xterm

    publishers:
       - warnings:
           console-log-parsers:
             - 'GNU C Compiler 4 (gcc)'
           resolve-relative-paths: true
       - email:
           recipients: '$EMAIL_NOTIFICATIONS'
           send-to-individuals: true

# vim: expandtab tabstop=2 shiftwidth=2
