---
- project:
    name: test-lava
    jobs:
      - test-lava

- job-template:
    name: 'test-lava'
    project-type: matrix
    concurrent: false
    node: master

    parameters:
      - string:
          name: GERRIT_PROJECT
          default: AGL/meta-agl
          description: "Project to build"
      - string:
          name: GERRIT_BRANCH
          default: master
          description: "branch to build"
      - string:
          name: GERRIT_REFSPEC
          default: refs/heads/master
          description: "refspec to build"
      - string:
          name: GERRIT_CHANGE_NUMBER
          default: "8313"
          description: "refspec to build"
      - string:
          name: GERRIT_PATCHSET_NUMBER
          default: "2"
          description: "refspec to build"
    axes:
      - axis:
          type: user-defined
          name: MACHINE
          values:
            - raspberrypi3
      - axis:
          type: slave
          name: label
          values:
            - agl-test-slave

    build-discarder:
      days-to-keep: 30
      num-to-keep: 2
      artifact-days-to-keep: -1
      artifact-num-to-keep: 5

      # triggers:
      #   - gerrit-trigger-patch-submitted-silent:
      #       name: 'AGL/AGL-repo'
      #       branch: 'refs/tags/chinook/**'

    wrappers:
      - agl-infra-wrappers:
          build-timeout: '{build-timeout}'
      - credentials-binding:
          - username-password-separated:
              credential-id: agl_main_lava_instance
              username: AGLLAVAUSER
              password: AGLLAVATOKEN
      - openstack:
          single-use: False

    builders:
      - shell:
          !include-raw-escape:
          - ../common/include-agl-header.sh
          - ../common/include-agl-repo.sh
          - ../common/include-agl-select.sh
          - ../common/include-agl-source-aglsetup.sh
          - ../common/include-agl-auto-conf.sh
          - ../common/include-agl-limit-parallelism.sh
          - ../common/include-agl-cat-auto-conf.sh
          - ../common/include-agl-bitbake-image.sh
          - ../common/include-agl-run-test-prepare.sh
          - ../common/include-agl-run-test-rsync-changeid.sh
          - ../common/include-agl-lava-labs-prepare.sh
          - ../common/include-agl-run-test-short.sh
          - ../common/include-agl-lava-jobs-submit.sh