---
- project:
    name: Osmocom-build-tags-against-master
    jobs:
      - Osmocom-build-tags-against-master

- job-template:
    name: 'Osmocom-build-tags-against-master'
    project-type: freestyle
    defaults: global
    description: |
        Build old releases of programs/libraries against "master of the day" libosmo*
        (<a href="https://osmocom.org/issues/3765">OS#3765</a>)
    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 30
    node: osmocom-master
    parameters:
      - string:
          name: BRANCH
          description: |
                osmo-ci.git branch where the osmocom-build-old-tags-against-master.sh gets pulled from
          default: 'master'
    builders:
      - shell: |
          docker run \
            --rm=true \
            --security-opt seccomp=$HOME/osmo-ci/_docker_playground/seccomp_profile.json \
            -e PARALLEL_MAKE="-j8" \
            -u build \
            -v "$PWD:/build" \
            -w /build \
            "$USER/debian-bookworm-build" \
            scripts/osmocom-build-old-tags-against-master.sh

          # Remove git repos and build results on success to free up space
          # Logs are kept
          rm -rf "$WORKSPACE"/_deps
          rm -rf "$WORKSPACE"/_temp/_inst*
    scm:
      - git:
          branches:
            - '$BRANCH'
          url: https://gerrit.osmocom.org/osmo-ci
          git-config-name: 'Jenkins Builder'
          git-config-email: 'jenkins@osmocom.org'
    triggers:
      - timed: "H 00 * * *"
    publishers:
       - archive:
          allow-empty: false
          artifacts: _temp/log/*
          case-sensitive: true
          only-if-success: false
       - email:
          notify-every-unstable-build: true
          recipients: 'jenkins-notifications@lists.osmocom.org'

# vim: expandtab tabstop=2 shiftwidth=2
