Migrate Arm CI TFTF L2 (tf-tftf-gerrit-tforg-l2) job

Signed-off-by: Leonardo Sandoval <leonardo.sandoval@linaro.org>
Change-Id: Iec8d7bf47613f85302313b4e7dfd9d44979fbb78
diff --git a/tf-tftf-gerrit-tforg-l2.yaml b/tf-tftf-gerrit-tforg-l2.yaml
new file mode 100644
index 0000000..9efb244
--- /dev/null
+++ b/tf-tftf-gerrit-tforg-l2.yaml
@@ -0,0 +1,118 @@
+- job:
+    name: tf-tftf-gerrit-tforg-l2
+    node: master
+    project-type: multijob
+    concurrent: true
+    disabled: false
+    description: |
+      Job that triggers for every TF-A-Tests patch approved with the Allow-CI+2
+      label on review.trustedfirmware.org.
+    properties:
+    - throttle:
+        option: project
+        enabled: true
+        max-total: 5
+    - build-discarder:
+        days-to-keep: 180
+        num-to-keep: 180
+    - authorization:
+        anonymous:
+          - job-read
+          - job-extended-read
+        lsandov1:
+          - job-read
+          - job-extended-read
+          - job-build
+          - job-cancel
+          - run-update
+    parameters:
+        - string:
+            name: GERRIT_PROJECT
+            default: 'TF-A/tf-a-tests'
+        - string:
+            name: GERRIT_BRANCH
+            default: 'master'
+        - string:
+            name: GERRIT_REFSPEC
+            default: 'refs/heads/master'
+    wrappers:
+      - credentials-binding:
+          - ssh-user-private-key:
+              credential-id: TFA_CI_BOT_USER_SSH_KEY
+              key-file-variable: CI_BOT_KEY
+              username-variable: CI_BOT_USERNAME
+              passphrase-variable: ''
+      - workspace-cleanup
+      - timestamps
+    builders:
+    - shell: |-
+        #!/bin/bash
+
+        set -e
+
+        cat << EOF > env.param
+        TFTF_GERRIT_PROJECT=${GERRIT_PROJECT}
+        TFTF_GERRIT_BRANCH=${GERRIT_BRANCH}
+        TFTF_GERRIT_REFSPEC=${GERRIT_REFSPEC}
+        EOF
+
+    - multijob:
+        condition: COMPLETED
+        name: Carry out level 1 tests
+        projects:
+        - kill-phase-on: NEVER
+          name: tf-tftf-gerrit-tforg-l1
+          current-parameters: true
+          property-file: env.param
+
+    - multijob:
+        condition: COMPLETED
+        name: Run Firmware Update Tests
+        projects:
+        - kill-phase-on: NEVER
+          name: tf-ci-gateway
+          predefined-parameters: |-
+            TEST_GROUPS=tftf-l2-fwu
+            TFTF_REFSPEC=$GERRIT_REFSPEC
+          property-file: env.param
+
+    - multijob:
+        condition: COMPLETED
+        name: Run Level 2 testing of TF-A-Tests
+        projects:
+        - kill-phase-on: NEVER
+          name: tf-ci-gateway
+          predefined-parameters: |-
+            TEST_GROUPS=tftf-l2-fvp-auxiliary tftf-l2-juno tf-l2-boot-tests-spm tftf-l2-fvp-dynamiq
+            TFTF_REFSPEC=$GERRIT_REFSPEC
+          property-file: env.param
+
+    - multijob:
+        condition: COMPLETED
+        name: Run extensive TF-A-Tests
+        projects:
+        - kill-phase-on: NEVER
+          name: tf-ci-gateway
+          predefined-parameters: |-
+            TEST_GROUPS=tftf-l2-extensive-tests-fvp
+            TFTF_REFSPEC=$GERRIT_REFSPEC
+          property-file: env.param
+
+
+    triggers:
+    - gerrit:
+        server-name: review.trustedfirmware.org
+        projects:
+        - branches:
+          - branch-compare-type: PLAIN
+            branch-pattern: master
+          project-compare-type: PLAIN
+          project-pattern: TF-A/tf-a-tests
+        trigger-on:
+          - comment-added-event:
+              approval-category: "Allow-CI"
+              approval-value: 2
+          override-votes: true
+          gerrit-build-successful-verified-value: 1
+          gerrit-build-failed-verified-value: -1
+          gerrit-build-unstable-verified-value: -1