+######################
+# Gerrit Branch Lock #
+######################
+
+- job-template:
+ name: '{project-name}-gerrit-branch-lock-{stream}'
+ id: gerrit-branch-lock
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ stream: master
+ gerrit_merge_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: (un)?lock branch$
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: '{build-node}'
+
+ properties:
+ - lf-infra-properties:
+ project: '{project}'
+ build-days-to-keep: 1
+
+ parameters:
+ - lf-infra-parameters:
+ project: '{project}'
+ stream: '{stream}'
+ branch: '{branch}'
+ lftools-version: '{lftools-version}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: 5
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '{git-url}'
+ refspec: ''
+ branch: '{branch}'
+ submodule-recursive: false
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_merge_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+
+ builders:
+ - shell: !include-raw-escape: ../shell/gerrit-branch-lock.sh
+
+
+ publishers:
+ - lf-infra-publish
+
+##################
+# JJB DEPLOY JOB #
+##################
+
+- lf_jjb_deploy_job: &lf_jjb_deploy_job
+ name: lf-jjb-deploy-job
+
+ ######################
+ # Default parameters #
+ ######################
+
+ branch: master
+ git-url: '$GIT_URL/$GERRIT_PROJECT'
+ stream: master
+ gerrit_jjb_deploy_job_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: 'jjb-deploy[:]* (?!\*+$).+$'
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: '{build-node}'
+ concurrent: true
+
+ properties:
+ - lf-infra-properties:
+ project: '{project}'
+ build-days-to-keep: 1
+
+ parameters:
+ - lf-infra-parameters:
+ project: '{project}'
+ stream: '{stream}'
+ branch: '{branch}'
+ lftools-version: '{lftools-version}'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: 5
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ builders:
+ - lf-pip-install:
+ pip-packages: jenkins-job-builder
+ - lf-infra-jjbini-sandbox
+ - shell: !include-raw-escape: ../shell/jjb-deploy-job.sh
+
+ publishers:
+ - lf-infra-publish
+
+- job-template:
+ name: '{project-name}-jjb-deploy-job'
+ id: gerrit-jjb-deploy-job
+ <<: *lf_jjb_deploy_job
+
+ scm:
+ - lf-infra-gerrit-scm:
+ git-url: '{git-url}'
+ refspec: 'refs/heads/{branch}'
+ branch: '{branch}'
+ submodule-recursive: true
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_jjb_deploy_job_triggers}'
+ projects:
+ - project-compare-type: ANT
+ project-pattern: '{project}'
+ branches:
+ - branch-compare-type: ANT
+ branch-pattern: '**/{branch}'
+
+- job-template:
+ name: '{project-name}-jjb-deploy-job'
+ id: github-jjb-deploy-job
+ <<: *lf_jjb_deploy_job
+
+ properties:
+ - github:
+ url: '{git-url}/{github-org}/{project}'
+
+ scm:
+ - lf-infra-github-scm:
+ url: '{git-clone-url}{github-org}/{project}'
+ refspec: '+refs/pull/*:refs/remotes/origin/pr/*'
+ branch: '$sha1'
+ submodule-recursive: true
+ choosing-strategy: default
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ triggers:
+ - lf-infra-github-pr-trigger:
+ trigger-phrase: '^jjb-deploy (?!\*+$).+$'
+ only-trigger-phrase: true
+ status-context: 'JJB Deploy Job'
+ permit-all: true
+ github-hooks: true
+ github-org: ''
+ github_pr_whitelist:
+ - ''
+ github_pr_admin_list:
+ - ''
+
+#############
+# JJB Merge #
+#############
+
+- lf_jjb_merge: &lf_jjb_merge
+ name: lf-jjb-merge
+
+ ######################
+ # Default parameters #
+ ######################
+
+ gerrit_merge_triggers:
+ - change-merged-event
+ - comment-added-contains-event:
+ comment-contains-value: remerge$
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ builders:
+ - lf-infra-jjbini
+ - shell: !include-raw-escape:
+ - ../shell/jjb-install.sh
+ - ../shell/jjb-merge-job.sh
+