From: Anil Belur Date: Tue, 16 Oct 2018 01:26:40 +0000 (+1000) Subject: Add view templates to manage Jenkins views X-Git-Tag: v0.27.0~17^2 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=f08880823d0d6e3e9ac62cd098af7b4c7661a8d6;p=releng%2Fglobal-jjb.git Add view templates to manage Jenkins views Add view templates for common views and csit jobs. Update docs and JJB tests. JIRA: RELENG-1259 Change-Id: I0fda1c089ef516bfd3bb3fb04ea4660d410fb094 Signed-off-by: Anil Belur --- diff --git a/.jjb-test/defaults.yaml b/.jjb-test/defaults.yaml index 4a7a3bb7..e7893e03 100644 --- a/.jjb-test/defaults.yaml +++ b/.jjb-test/defaults.yaml @@ -27,3 +27,9 @@ project: releng/ciman stream: latest build-node: build-vm + + view-regex: '{project-name}-.*' + view-description: 'List of {project-name} jobs' + view-filter-executors: false + view-filter-queue: false + view-recurse: false diff --git a/.jjb-test/lf-ci-jobs.yaml b/.jjb-test/lf-ci-jobs.yaml index c9dfdfc5..63f94bfe 100644 --- a/.jjb-test/lf-ci-jobs.yaml +++ b/.jjb-test/lf-ci-jobs.yaml @@ -59,3 +59,11 @@ templates: - java-builder - mininet + +- project: + name: ci-jobs-view + project-name: ci-jobs + views: + - common-view + view-regex: '.*-ci-jobs$|.*-openstack-jobs$|.*-packer-jobs$' + view-description: 'List of ci-jobs, openstack and packer jobs' diff --git a/.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml b/.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml index 5b7173e8..83a4d490 100644 --- a/.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml +++ b/.jjb-test/lf-ci-jobs/jenkins-cfg-merge-minimal.yaml @@ -5,3 +5,11 @@ - 'gerrit-jenkins-cfg-merge' project-name: ci-management + +- project: + name: jenkins-cfg-jobs-view + project-name: jenkins-cfg + views: + - common-view + view-regex: '^jenkins-cfg.*' + view-description: 'List of jenkins-cfg jobs' diff --git a/.jjb-test/lf-maven-jobs.yaml b/.jjb-test/lf-maven-jobs.yaml index a42214a5..98b26e5e 100644 --- a/.jjb-test/lf-maven-jobs.yaml +++ b/.jjb-test/lf-maven-jobs.yaml @@ -35,3 +35,11 @@ mvn-settings: aproject-settings mvn-snapshot-id: fakeproject-snapshots nexus-snapshot-repo: fakeproject-snapshots + +- project: + name: maven-jobs-view + project-name: maven + views: + - common-view + view-regex: '.*-maven$' + view-description: 'List of maven jobs' diff --git a/.jjb-test/lf-node-jobs.yaml b/.jjb-test/lf-node-jobs.yaml index a0e82352..ed402798 100644 --- a/.jjb-test/lf-node-jobs.yaml +++ b/.jjb-test/lf-node-jobs.yaml @@ -12,3 +12,11 @@ - "{project-name}-github-node-jobs" project-name: github-node + +- project: + name: node-jobs-view + project-name: node + views: + - common-view + view-regex: '.*-node$' + view-description: 'List of node jobs' diff --git a/.jjb-test/lf-openstack.yaml b/.jjb-test/lf-openstack.yaml index 5b11b599..12f55e8e 100644 --- a/.jjb-test/lf-openstack.yaml +++ b/.jjb-test/lf-openstack.yaml @@ -7,3 +7,11 @@ default: test-lf-stack-delete publishers: - lf-stack-delete + +- project: + name: openstack-jobs-view + project-name: openstack + views: + - common-view + view-regex: '.*-openstack$' + view-description: 'List of openstack jobs' diff --git a/.jjb-test/lf-python-jobs.yaml b/.jjb-test/lf-python-jobs.yaml index feb154f3..9961935e 100644 --- a/.jjb-test/lf-python-jobs.yaml +++ b/.jjb-test/lf-python-jobs.yaml @@ -14,3 +14,11 @@ - github-tox-sonar project-name: github-python + +- project: + name: python-jobs-view + project-name: python + views: + - common-view + view-regex: '.*-python$' + view-description: 'List of Python jobs' diff --git a/.jjb-test/lf-rtd-jobs.yaml b/.jjb-test/lf-rtd-jobs.yaml index 1f1f7001..975c47a9 100644 --- a/.jjb-test/lf-rtd-jobs.yaml +++ b/.jjb-test/lf-rtd-jobs.yaml @@ -18,3 +18,11 @@ project-name: github-rtd rtd-build-url: fake-rtd-build-url rtd-token: fake-rtd-token + +- project: + name: rtd-jobs-view + project-name: rtd + views: + - common-view + view-regex: '.*-rtd$' + view-description: 'List of rtd jobs' diff --git a/docs/jjb/lf-views.rst b/docs/jjb/lf-views.rst new file mode 100644 index 00000000..013dfbe5 --- /dev/null +++ b/docs/jjb/lf-views.rst @@ -0,0 +1,79 @@ +.. _lf-global-jjb-views: + +############# +Jenkins Views +############# + +View Templates +============== + +JJB view-templates provides a way to manage Jenkins views through code. + + +Common view +----------- + +Common view groups jobs related to a project and supports the following +columns. + +:Columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + - build-button + - jacoco + - find-bugs + - robot-list + +:Template Names: + - common-view + - {project-name} + +:Required parameters: + + :project-name: The name of the view. + :view-description: View description. (Generally set to 'List of + {project-name} jobs' in defaults.yaml) + :view-filter-executors: View filter executor. (Generally set to 'false' in + defaults.yaml) + :view-filter-queue: View filter queue. (Generally set to 'false' in + defaults.yaml) + :view-regex: Regex to match the jobs. (Generally set to '^{project-name}-.*' + in defaults.yaml) + :view-recurse: View recurse. (Generally set to 'false' in defaults.yaml) + +Integration CSIT view +--------------------- + +Integration CSIT view provides a view for integration or CSIT jobs. +The view supports the following set of columns. + +:Columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + - build-button + - robot-list + +:Template Names: + - integration-csit-view + - {project-name} + +:Required parameters: + + :project-name: The name of the view. + :view-description: View description. (Generally set to 'List of + {project-name} jobs' in defaults.yaml) + :view-filter-executors: View filter executor. (Generally set to 'false' in + defaults.yaml) + :view-filter-queue: View filter queue. (Generally set to 'false' in + defaults.yaml) + :view-regex: Regex to match the jobs. (Generally set to '^{project-name}-.*' + in defaults.yaml) + :view-recurse: View recurse. (Generally set to 'false' in defaults.yaml) diff --git a/jjb/lf-views.yaml b/jjb/lf-views.yaml new file mode 100644 index 00000000..b09ddba1 --- /dev/null +++ b/jjb/lf-views.yaml @@ -0,0 +1,58 @@ +--- +######################## +# common view template # +######################## + +- view-template: + id: 'common-view' + name: '{project-name}' + + ###################### + # view Configuration # + ###################### + + view-type: list + filter-executors: '{view-filter-executors}' + filter-queue: '{view-filter-queue}' + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + - build-button + - jacoco + - find-bugs + - robot-list + recurse: '{view-recurse}' + regex: '{view-regex}' + description: '{view-description}' + +############################# +# integration view template # +############################# + +- view-template: + id: 'integration-csit-view' + name: '{project-name}' + + ###################### + # view Configuration # + ###################### + + view-type: list + filter-executors: '{view-filter-executors}' + filter-queue: '{view-filter-queue}' + columns: + - status + - weather + - job + - last-success + - last-failure + - last-duration + - build-button + - robot-list + recurse: '{view-recurse}' + regex: '{view-regex}' + description: '{view-description}' diff --git a/releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml b/releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml new file mode 100644 index 00000000..d39b80f8 --- /dev/null +++ b/releasenotes/notes/lf-view-templates-add-64911f643dc053d8.yaml @@ -0,0 +1,83 @@ +--- +features: + - | + New view-templates ``common-view`` and ``integration-csit-view`` are + available for projects to manage Jenkins views through code. + + To use the ``common-view`` template in a project. + + Usage: + + .. code-block:: yaml + + - project: + ... + views: + - common-view + + To use the ``integration-csit-view`` template in a project. + + Usage: + + .. code-block:: yaml + + - project: + ... + views: + - integration-csit-view + + - | + A separate project section can be defined for views that are common to a + set of jobs. This creates a list-type view with ```` in + Jenkins which lists all the jobs under the view. + + Usage: + + .. code-block:: yaml + + - project: + name: + project: + project-name: + views: + - common-view + + Example Usage: + + .. code-block:: yaml + + --- + - defaults: + name: global + view-regex: '^{project-name}-.*' + view-description: 'default view description' + + - project: + name: project-view + project: project + project-name: project + views: + - common-view + + - project: + name: project-stream1 + project: project + project-name: project + jobs: + - '{project-name}-{seq}' + seq: + - a + - b + + - project: + name: project-stream2 + project: project + project-name: project + jobs: + - '{project-name}-{seq}' + seq: + - x + - y + + - job-template: + name: '{project-name}-{seq}'