Add tf-a-lts-patch-stack-watcher.yaml

This job will trigger Allow-CI job, Allow-CI+2, by default,
if a new patch/patch stack is submitted to the lts branches.
It also monitors the existing unmerged patch/patch stack,
if the submit requirement is met, it will merge it. [1]

[1]: https://linaro.atlassian.net/browse/TFC-546

Signed-off-by: Arthur She <arthur.she@linaro.org>
Change-Id: I59e62182573ae4ef67989ccb119806890a30da6c
diff --git a/tf-a-lts-patch-stack-watcher.yaml b/tf-a-lts-patch-stack-watcher.yaml
new file mode 100644
index 0000000..350ea32
--- /dev/null
+++ b/tf-a-lts-patch-stack-watcher.yaml
@@ -0,0 +1,62 @@
+- job:
+    name: tf-a-lts-patch-stack-watcher
+    node: master
+    project-type: freestyle
+    concurrent: false
+    description:
+        This job will trigger Allow-CI job whenever a new patch is created.
+        It also monitors all patches, if submit requirement is met, it
+        will merge the patch
+    disabled: false
+    parameters:
+    - string:
+        name: ALLOW_CI_JOB
+        description: |
+          To trigger Allow-CI+1 or Allow-CI+2 job when a new patch is created
+        default: 'Allow-CI=2'
+    builders:
+    - shell:
+        !include-raw: scripts/tf-a-lts-patch-stack-watcher.sh
+    properties:
+    - build-discarder:
+        days-to-keep: 60
+        num-to-keep: 120
+    triggers:
+    - gerrit:
+        silent: true
+        server-name: 'review.trustedfirmware.org'
+        projects:
+        - branches:
+          - branch-compare-type: REG_EXP
+            branch-pattern: 'lts-v.*'
+          project-compare-type: PLAIN
+          project-pattern: 'TF-A/trusted-firmware-a'
+        trigger-on:
+        - comment-added-event:
+            approval-category: "Verified"
+            approval-value: 1
+        - comment-added-event:
+            approval-category: "Code-Owner-Review"
+            approval-value: 1
+        - comment-added-event:
+            approval-category: "Allow-CI"
+            approval-value: 1
+        - comment-added-event:
+            approval-category: "Maintainer-Review"
+            approval-value: 1
+        - patchset-created-event:
+            exclude-drafts: false
+            exclude-trivial-rebase: false
+            exclude-no-code-change: false
+            exclude-private: false
+            exclude-wip: false
+    wrappers:
+    - timestamps
+    - 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: ''
+    publishers:
+    - workspace-cleanup