- job:
    name: build-package-obs
    description: See https://wiki.linaro.org/Platform/Systems/OBS
    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: 'dsc source url or filename'
        - string:
            name: repo
            description: 'repository to upload to'
            default: 'linaro-staging'
        - bool:
            name: appendversion
            description: 'append version with linaro$dist'
            default: 'false'
        - bool:
            name: backport
            description: 'mark as backport'
            default: 'false'
    disabled: false
    node: docker-buster
    display-name: 'Build package on OBS'
    wrappers:
        - timestamps
        - credentials-binding:
            - text:
                credential-id: OSCRC_USER
                variable: OSCRC_USER
        - credentials-binding:
            - text:
                credential-id: OSCRC_PASS
                variable: OSCRC_PASS
        - build-name:
            name: '#${BUILD_NUMBER}: ${ENV,var="source"}'
    builders:
        - shell:
            !include-raw: build-package/builder-obs.sh
    publishers:
        - email-ext:
            recipients: '$DEFAULT_RECIPIENTS, packages@lists.linaro.org'
            attach-build-log: true
            failure: true
            still-failing: true
            subject: 'build-package: ${ENV,var="source"} failed'
            matrix-trigger: only-configurations
            body: |
                Build ${BUILD_NUMBER} for ${ENV,var="source"} failed
                Build Log: ${BUILD_URL}/consoleText
                Build URL: ${BUILD_URL}
            send-to:
                - requester
