- job:
    name: pkgdeb-build-auto-backports
    node: debian-jessie

    wrappers:
      - build-timeout:
          timeout: 120
      - timestamps

    builders:
    - zuul-git-prep
    - shell: |
          #!/bin/bash
          BRANCH=$(echo $ZUUL_REFNAME | cut -d/ -f2)

          set -x
          set -e

          # NOTE(pabelanger): This needs to be changed, currently hardcoded.
          sudo cp /etc/apt/sources.list.available.d/debian-openstack-newton.list /etc/apt/sources.list.d
          sudo apt-get update
          sudo apt-get install -y openstack-pkg-tools
          sudo pkgos-infra-install-sbuild --sbuild-chroot-name jessie-$BRANCH-backports
          ./check-and-build-bpo

    publishers:
      - console-log

- job:
    name: pkgdeb-publish-auto-backports
    node: debian-jessie

    wrappers:
      - build-timeout:
          timeout: 120
      - timestamps

    builders:
    - zuul-git-prep
    - shell: |
          #!/bin/bash
          BRANCH=$(echo $ZUUL_REFNAME | cut -d/ -f2)

          set -x
          set -e

          # NOTE(pabelanger): This needs to be changed, currently hardcoded.
          sudo cp /etc/apt/sources.list.available.d/debian-openstack-newton.list /etc/apt/sources.list.d
          sudo apt-get update
          sudo apt-get install -y openstack-pkg-tools
          sudo pkgos-infra-install-sbuild --sbuild-chroot-name jessie-$BRANCH-backports
          ./check-and-build-bpo

    publishers:
      - deb-pkgs:
          project: deb-auto-backports
      - console-log