X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=jjb%2Flf-python-jobs.yaml;h=904a3f1638d912af61121fc2727c15a468df1be5;hb=refs%2Ftags%2Fv0.10.4;hp=530d05b54b662bb1f524c073e82c68c45a8eb764;hpb=2107df3888d36e52cf5758d42f1e71f0d06840d0;p=releng%2Fglobal-jjb.git diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index 530d05b5..904a3f16 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -1,28 +1,64 @@ --- -################# -# Job Templates # -################# +- job-group: + name: '{project-name}-python-jobs' -- job-template: - # Python projects typically use tox to run testing. - name: '{project-name}-tox-verify-{stream}' + # This job group contains all the recommended jobs that should be deployed + # for any project ci that is using Gerrit. - # Required Variables: - # branch: git branch (default: master) - # tox-dir: directory containing the project's tox.ini relative to - # the workspace. Empty works if tox.ini is at project root. + jobs: + - gerrit-tox-verify - project-type: freestyle - node: '{build-node}' - concurrent: true +- job-group: + name: '{project-name}-github-python-jobs' + + # This job group contains all the recommended jobs that should be deployed + # for any project ci that is using GitHub. + + jobs: + - github-tox-verify + +############## +# Tox Verify # +############## + +- lf_tox_verify: &lf_tox_verify + name: lf-tox-verify + + # Tox runner to verify a project + # + # Runs tox to verify a project. + # + # Required Parameters: + # + # :build-node: The node to run build on. + # :jenkins-ssh-credential: Credential to use for SSH. (Generally should + # be configured in defaults.yaml) + # + # Optional Parameters: + # + # :branch: The branch to build against. (default: master) + # :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) + # :build-timeout: Timeout in seconds before aborting build. (default: 10) + # :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + # :stream: Keyword that can be used to represent a release code-name. + # Often the same as the branch. (default: master) + # :submodule-recursive: Whether to checkout submodules recursively. + # (default: true) + # :tox-dir: Directory containing the project's tox.ini relative to + # the workspace. Empty works if tox.ini is at project root. + # (default: '') + # :tox-envs: Tox environments to run. If blank run everything described + # in tox.ini. (default: '') ###################### # Default parameters # ###################### branch: master + build-days-to-keep: 7 build-timeout: 10 git-url: '$GIT_URL/$GERRIT_PROJECT' + stream: master submodule-recursive: true tox-dir: '' tox-envs: '' @@ -31,18 +67,65 @@ # Job Configuration # ##################### + project-type: freestyle + node: '{build-node}' + concurrent: true + properties: - lf-infra-properties: - build-days-to-keep: 7 + build-days-to-keep: '{build-days-to-keep}' parameters: - lf-infra-parameters: project: '{project}' branch: '{branch}' + stream: '{stream}' + lftools-version: '{lftools-version}' - lf-infra-tox-parameters: tox-dir: '{tox-dir}' tox-envs: '{tox-envs}' + wrappers: + - lf-infra-wrappers: + build-timeout: '{build-timeout}' + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + builders: + - shell: !include-raw-escape: + # Workaround issue where the tox run later breaks the lftools virtualenv. + # Without running the install first the run in the publisher will fail + # due to missing lftools because it gets installed into a tox venv. + - ../shell/lftools-install.sh + - shell: !include-raw-escape: + - ../shell/tox-install.sh + - ../shell/tox-run.sh + + publishers: + - lf-infra-publish + +- job-template: + # Python projects typically use tox to run testing. + name: '{project-name}-tox-verify-{stream}' + id: gerrit-tox-verify + <<: *lf_tox_verify + + ###################### + # Default parameters # + ###################### + + gerrit_verify_triggers: + - patchset-created-event: + exclude-drafts: true + exclude-trivial-rebase: false + exclude-no-code-change: false + - draft-published-event + - comment-added-contains-event: + comment-contains-value: recheck$ + + ##################### + # Job Configuration # + ##################### + scm: - lf-infra-gerrit-scm: jenkins-ssh-credential: '{jenkins-ssh-credential}' @@ -52,22 +135,10 @@ submodule-recursive: '{submodule-recursive}' choosing-strategy: gerrit - wrappers: - - lf-infra-wrappers: - build-timeout: '{build-timeout}' - jenkins-ssh-credential: '{jenkins-ssh-credential}' - triggers: - gerrit: server-name: '{gerrit-server-name}' - trigger-on: - - patchset-created-event: - exclude-drafts: false - exclude-trivial-rebase: false - exclude-no-code-change: false - - draft-published-event - - comment-added-contains-event: - comment-contains-value: recheck$ + trigger-on: '{obj:gerrit_verify_triggers}' projects: - project-compare-type: ANT project-pattern: '{project}' @@ -75,15 +146,30 @@ - branch-compare-type: ANT branch-pattern: '**/{branch}' - builders: - - shell: !include-raw-escape: - # Workaround issue where the tox run later breaks the lftools virtualenv. - # Without running the install first the run in the publisher will fail - # due to missing lftools because it gets installed into a tox venv. - - ../shell/lftools-install.sh - - shell: !include-raw-escape: - - ../shell/tox-install.sh - - ../shell/tox-run.sh +- job-template: + # Python projects typically use tox to run testing. + name: '{project-name}-tox-verify-{stream}' + id: github-tox-verify + <<: *lf_tox_verify - publishers: - - lf-infra-publish + 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: '{branch}' + submodule-recursive: '{submodule-recursive}' + choosing-strategy: default + jenkins-ssh-credential: '{jenkins-ssh-credential}' + + triggers: + - github-pull-request: + trigger-phrase: '^recheck$' + only-trigger-phrase: false + status-context: 'JJB Verify' + permit-all: true + github-hooks: true + auto-close-on-fail: false