---
- job:
    name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}"
    display-name: "elastic / elasticsearch # %BRANCH% - pull request {pr-job}"
    description: "Testing of Elasticsearch pull requests - {pr-job}"
    workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}"
    scm:
      - git:
          refspec: "+refs/pull/${{ghprbPullId}}/*:refs/remotes/origin/pr/${{ghprbPullId}}/*"
          branch: "${ghprbActualCommit}"
    triggers:
      - github-pull-request:
          org-list:
            - elastic
          allow-whitelist-orgs-as-admins: true
          trigger-phrase: '.*run\W+elasticsearch-ci/{pr-job}.*'
          github-hooks: true
          status-context: elasticsearch-ci/{pr-job}
          cancel-builds-on-update: true
          white-list-target-branches:
            - %BRANCH%
          excluded-regions:
            - ^docs/.*
          black-list-labels:
            - '>test-mute'
    builders:
      - inject:
          properties-file: '.ci/java-versions.properties'
          properties-content: |
            JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
            RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
            JAVA15_HOME=$HOME/.java/openjdk15
      - shell: |
          #!/usr/local/bin/runbld --redirect-stderr
          $WORKSPACE/.ci/scripts/run-gradle.sh {gradle-args}

---
- job:
    name: "elastic+elasticsearch+%BRANCH%+pull-request/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}"
    display-name: "elastic / elasticsearch # %BRANCH% - pull request {pr-job}"
    description: "Testing of Elasticsearch pull requests - {pr-job}"
    workspace: "/dev/shm/elastic+elasticsearch+%BRANCH%+pull-request+{pr-job}"
    scm:
      - git:
          refspec: "+refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/*"
          branch: "${ghprbActualCommit}"
    triggers:
      - github-pull-request:
          org-list:
            - elastic
          allow-whitelist-orgs-as-admins: true
          trigger-phrase: '.*run\W+elasticsearch-ci/{pr-job}.*'
          github-hooks: true
          status-context: elasticsearch-ci/{pr-job}
          cancel-builds-on-update: true
          white-list-target-branches:
            - %BRANCH%
          excluded-regions:
            - ^docs/.*
          black-list-labels:
            - '>test-mute'
    builders:
      - inject:
          properties-file: '.ci/java-versions.properties'
          properties-content: |
            JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
            RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
            JAVA15_HOME=$HOME/.java/openjdk15
      - shell: |
          #!/usr/local/bin/runbld --redirect-stderr
          $WORKSPACE/.ci/scripts/run-gradle.sh {gradle-args}

Fix escaping in JJBB template
Fix escaping in JJBB template
