- job:
    name: ci-dockerfile-build
    project-type: freestyle
    defaults: global
    properties:
        - authorization:
            anonymous:
                - job-discover
            everyone-flat:
                - job-read
                - job-extended-read
                - job-build
                - job-cancel
        - build-discarder:
            days-to-keep: 90
            num-to-keep: 200
        - build-blocker:
            use-build-blocker: true
            blocking-jobs:
              - "ci-docker.*"
            block-level: 'NODE'
    disabled: false
    display-name: 'Build docker image'
    parameters:
        - string:
            name: image
            description: 'docker image to build'
        - label:
            name: nodelabel
            description: 'build machine'
    wrappers:
        - timestamps
        - credentials-binding:
            - text:
                credential-id: DOCKER_AUTH
                variable: DOCKER_AUTH
    builders:
        - shell: |
            #!/bin/bash -e
            curl -L -o ${WORKSPACE}/config.json https://ci.linaro.org/userContent/config.json --fail
        - shell:
            !include-raw: ci-dockerfiles-deployment/build-image.sh
    publishers:
        - email:
            recipients: linaro-infrastructure-errors@lists.linaro.org
