#include tcwg/default.yaml.inc

- job:
    name: tcwg-update-lnt-results
    project-type: freestyle
    defaults: global
    properties:
        - default-properties
    parameters:
        - label:
            name: nodes
            default: tcwg-lnt
            all-nodes: true
            matching-label: 'allCases'
            description: 'Machines or label to run on'
        - string:
            name: ci_project
            default: 'default'
            description: "CI project ID; used as namespace for git branches"
        - string:
            name: ci_config
            default: 'default'
            description: "CI configuration ID; used as name of git branches"
        - bool:
            name: verbose
            default: 'true'
            description: 'Whether to be verbose'
        - string:
            name: scripts_branch
            default: master
            description: 'Scripts revision to use'
    disabled: false
    node: tcwg-coordinator
    concurrent: true
    display-name: 'TCWG Update LNT results'
    workspace: workspace/tcwg-update-lnt-results_${NODE_NAME}_${EXECUTOR_NUMBER}
    scm:
      - jenkins-scripts
    wrappers:
        - timeout:
            timeout: 600
        - timestamps
        - ssh-agent-credentials:
            # tcwg-buildslave user id
            users:
                - 'e0958a95-204f-4c14-a66c-5e2be6c5d50a'
        - build-name:
            name: '#${BUILD_NUMBER}-${NODE_NAME} ($ci_project--$ci_config)'
    builders:
      - shell:
          command: |
            #!/bin/bash
            set -ex

            ./jenkins-scripts/tcwg-update-lnt-results.sh \
               --lnt_config "$NODE_NAME" \
               --ci_project "$ci_project" \
               --ci_config "$ci_config" \
               --verbose "$verbose"
    publishers:
      - email-ext:
          recipients: 'laurent.alfonsi@linaro.org,maxim.kuvyrkov@linaro.org'
