- job:
    name: upload-deb-package
    description: upload packages to new repository
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-read
                - job-extended-read
            everyone-flat:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 30
            num-to-keep: 30
    parameters:
        - string:
            name: source
            description: 'zip or dsc source url'
        - string:
            name: zip
            description: 'is source a zip?'
            default: false
        - string:
            name: repo
            description: 'repository to upload to'
            default: 'linaro-staging-sid'
    disabled: false
    node: deb.ctt.linaro.org
    display-name: 'Upload packages to repositories'
    wrappers:
        - timestamps
        - build-name:
            name: '#${BUILD_NUMBER}: ${ENV,var="source"}'
    builders:
        - shell:
            !include-raw: build-package/upload-deb.sh
    publishers:
        - email-ext:
            recipients: '$DEFAULT_RECIPIENTS, linaro-infrastructure-errors@lists.linaro.org'
            attach-build-log: true
            failure: true
            still-failing: true
            subject: 'build-package: ${ENV,var="source"} failed'
            body: |
                Build ${BUILD_NUMBER} for ${ENV,var="source"} failed
                Build Log: ${BUILD_URL}/consoleText
                Build URL: ${BUILD_URL}
            send-to:
                - requester
