- project:
    name: registry-rebuild-upload-titan
    jobs:
      - registry-rebuild-upload-titan
      - registry-rebuild-upload-ttcn3-bts-tests
      - registry-rebuild-upload-testenv

- scm:
    name: osmocom-docker-playground
    scm:
        - git:
            url: https://gerrit.osmocom.org/docker-playground
            skip-tag: true
            branches:
                - 'origin/master'


- job:
    name: registry-rebuild-upload-titan
    description: |
        Rebuild + push ttcn3 base images (debian-bookworm-titan) in our private
        registry.osmocom.org
        <br><br>
        Related:<br>
        <ul>
          <li> <a href="https://osmocom.org/issues/5017">OS#5017</a>
        </ul>
    properties:
      - build-discarder:
          days-to-keep: 30
          num-to-keep: 30
    node: osmocom-master
    scm:
      - 'osmocom-docker-playground'
    builders:
      - shell: |
          REGISTRY="registry.osmocom.org"
          make -C debian-bookworm-titan REGISTRY_HOST=$REGISTRY
          docker push "$REGISTRY/$USER/debian-bookworm-titan"
    publishers:
      - email:
          notify-every-unstable-build: true
          recipients: 'jenkins-notifications@lists.osmocom.org'

- job:
    name: registry-rebuild-upload-ttcn3-bts-tests
    description: |
        Rebuild + push ttcn3-bts-test image in our private registry.osmocom.org.
        This docker container is used by osmo-gsm-tester main unit to run TTCN3
        BTS_Tests testsuite against real hardware.
        <br><br>
        Related:<br>
        <ul>
          <li>SYS#5765
        </ul>
    node: osmocom-master
    triggers:
      - reverse:
            jobs:
                - registry-rebuild-upload-titan
    scm:
      - 'osmocom-docker-playground'
    builders:
      - shell: |
          REGISTRY="registry.osmocom.org"
          make -C ttcn3-bts-test REGISTRY_HOST=$REGISTRY
          docker push "$REGISTRY/$USER/ttcn3-bts-test"
    publishers:
      - email:
          notify-every-unstable-build: true
          recipients: 'jenkins-notifications@lists.osmocom.org'

- job:
    name: registry-rebuild-upload-testenv
    description: Rebuild + publish podman images for testenv (OS#6494)
    parameters:
      - string:
          name: BRANCH
          description: osmo-ttcn3-hacks.git branch
          default: 'master'
    scm:
      - git:
          url: https://gerrit.osmocom.org/osmo-ttcn3-hacks
          branches:
            - '$BRANCH'
    builders:
      - shell: |
          REGISTRY="registry.osmocom.org"
          DISTRO="debian:bookworm"
          IMAGE="registry.osmocom.org/osmocom-build/"$(echo "$DISTRO" | tr : -)"-osmo-ttcn3-testenv"

          podman build \
            --build-arg DISTRO="$DISTRO" \
            --build-arg REGISTRY="$REGISTRY" \
            -t "$IMAGE" \
            _testenv/data/podman

          podman push "$IMAGE"
    publishers:
       - email:
          notify-every-unstable-build: true
          recipients: 'jenkins-notifications@lists.osmocom.org'

# vim: expandtab tabstop=2 shiftwidth=2