- job:
    name: build-kvmtool
    project-type: freestyle
    defaults: global
    logrotate:
        daysToKeep: 30
        numToKeep: 30
        artifactNumToKeep: 1
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            everyone-flat:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
    disabled: true
    node: docker-xenial
    display-name: 'DELETE ME'
    scm:
        - git:
            url: https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git
            refspec: +refs/heads/master:refs/remotes/origin/master
            name: origin
            branches:
                - refs/heads/master
            skip-tag: true
            shallow-clone: false
            clean:
                after: true
            wipe-workspace: false
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}-${GIT_REVISION,length=8}'
    builders:
        - shell: |
            #!/bin/bash

            set -e

            export upstream_repo=git://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git
            export upstream_source=kvmtool
            export packaging_repo=git://anonscm.debian.org/collab-maint/kvmtool.git
            export packaging_dir=kvmtool-debian

            wget https://git.linaro.org/ci/ubuntu-packaging-tools.git/blob_plain/HEAD:/jenkins-makesources

            bash -x ./jenkins-makesources

            cat > kvmtool-params <<EOF
            source=$BUILD_URL/artifact/`cat kvmtool.dsc`
            repo=Qemu
            EOF
    publishers:
        - archive:
            artifacts: '*.changes, *.dsc, *.gz, *.xz'
        - trigger-parameterized-builds:
            - project: build-package-obs
              property-file: kvmtool-params
              condition: SUCCESS
        - email:
            recipients: 'riku.voipio@linaro.org'
