diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml index 84901db572..b77484744c 100644 --- a/modules/openstack_project/files/zuul/layout.yaml +++ b/modules/openstack_project/files/zuul/layout.yaml @@ -3,6 +3,7 @@ includes: pipelines: - name: check + description: Newly uploaded patchsets enter this pipeline to receive an initial +/-1 Verified vote from Jenkins. manager: IndependentPipelineManager trigger: - event: patchset-created @@ -14,6 +15,7 @@ pipelines: verified: -1 - name: gate + description: Changes that have been approved by core developers are enqueued in order in this pipeline, and if they pass tests in Jenkins, will be merged. manager: DependentPipelineManager trigger: - event: comment-added @@ -30,18 +32,21 @@ pipelines: verified: -2 - name: post + description: This pipeline runs jobs that operate after each change is merged. manager: IndependentPipelineManager trigger: - event: ref-updated ref: ^(?!(devnull|refs/.*)).*$ - name: publish + description: When a commit is tagged, this pipeline runs jobs that operate on tags, such as uploading releases. manager: IndependentPipelineManager trigger: - event: ref-updated ref: ^refs/tags/.*$ - name: silent + description: This pipeline is used for silently testing new jobs. manager: IndependentPipelineManager trigger: - event: patchset-created diff --git a/modules/openstack_project/files/zuul/status.html b/modules/openstack_project/files/zuul/status.html new file mode 100644 index 0000000000..359e609cb3 --- /dev/null +++ b/modules/openstack_project/files/zuul/status.html @@ -0,0 +1,166 @@ + + + + + Zuul Status + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

+

+
+
+
+ +
+ +
+

Zuul Status

+

Zuul is a pipeline oriented project gating and automation + system. Each of the sections below is a separate pipeline + configured to automate some portion of the testing or + operation of the OpenStack project. For more information, please see + the Zuul reference manual. +

+ +
+
+
+
+
+ +
+
+ +
+ + diff --git a/modules/openstack_project/files/zuul/status.js b/modules/openstack_project/files/zuul/status.js new file mode 100644 index 0000000000..d540a36eb7 --- /dev/null +++ b/modules/openstack_project/files/zuul/status.js @@ -0,0 +1,103 @@ +// Copyright 2012 OpenStack Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may +// not use this file except in compliance with the License. You may obtain +// a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. + +function format_pipeline(data) { + var html = '

'+ + data['name']+'

'; + if (data['description'] != null) { + html += '

'+data['description']+'

'; + } + + $.each(data['change_queues'], function(change_queue_i, change_queue) { + if (data['change_queues'].length > 1) { + html += ' Change queue: '; + + var name = change_queue['name']; + html += ''; + if (name.length > 32) { + name = name.substr(0,32) + '...'; + } + html += name + '' + } + $.each(change_queue['heads'], function(head_i, head) { + $.each(head, function(change_i, change) { + if (change_i > 0) { + html += '
' + } + html += format_change(change); + }); + }); + }); + + html += '
'; + return html; +} + +function format_change(change) { + var html = '
'; + + html += ''+change['project']+''; + html += ''; + html += change['id']+'
'; + + html += '
'; + $.each(change['jobs'], function(i, job) { + result = job['result']; + if (result == null) { + result = 'unknown'; + } + html += ''; + if (job['url'] != null) { + html += ''; + } + html += job['name']; + if (job['url'] != null) { + html += ''; + } + html += ': '+result+''; + if (job['voting'] == false) { + html += ' (non-voting)'; + } + }); + + html += '
'; + return html; +} + +function update() { + var html = ''; + + $.getJSON('/status.json', function(data) { + if ('message' in data) { + $("#message-container").attr('class', 'topMessage'); + $("#message").html(''+data['message']+''); + } else { + $("#message-container").removeClass('topMessage'); + } + + html += '
'; + + $.each(data['pipelines'], function(i, pipeline) { + html = html + format_pipeline(pipeline); + }); + + html += '
'; + $("#pipeline-container").html(html); + }); + setTimeout(update, 5000); +} + +$(function() { + update(); +}); diff --git a/modules/openstack_project/manifests/zuul.pp b/modules/openstack_project/manifests/zuul.pp index 37186eb03f..b7d3777ceb 100644 --- a/modules/openstack_project/manifests/zuul.pp +++ b/modules/openstack_project/manifests/zuul.pp @@ -61,4 +61,31 @@ class openstack_project::zuul( source => 'puppet:///modules/openstack_project/zuul/scoreboard.html', require => File['/var/lib/recheckwatch'], } + + file { '/var/lib/zuul/www': + ensure => directory, + require => File['/var/lib/zuul'], + } + + file { '/var/lib/zuul/www/index.html': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/status.html', + require => File['/var/lib/zuul/www'], + } + + package { 'libjs-jquery': + ensure => present, + } + + file { '/var/lib/zuul/www/jquery.min.js': + ensure => link, + target => '/usr/share/javascript/jquery/jquery.min.js', + require => Package['libjs-jquery'], + } + + file { '/var/lib/zuul/www/status.js': + ensure => present, + source => 'puppet:///modules/openstack_project/zuul/status.js', + require => File['/var/lib/zuul/www'], + } } diff --git a/modules/zuul/manifests/init.pp b/modules/zuul/manifests/init.pp index 37ed97d0b3..81c5b08397 100644 --- a/modules/zuul/manifests/init.pp +++ b/modules/zuul/manifests/init.pp @@ -124,7 +124,7 @@ class zuul ( file { '/var/lib/zuul/git': ensure => directory, owner => 'zuul', - require => User['zuul'], + require => File['/var/lib/zuul'], } file { '/var/lib/zuul/ssh': diff --git a/modules/zuul/templates/zuul.vhost.erb b/modules/zuul/templates/zuul.vhost.erb index 74861005da..580d7eac9a 100644 --- a/modules/zuul/templates/zuul.vhost.erb +++ b/modules/zuul/templates/zuul.vhost.erb @@ -1,5 +1,6 @@ :80> ServerAdmin <%= scope.lookupvar("::zuul::serveradmin") %> + DocumentRoot /var/lib/zuul/www ErrorLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::zuul::vhost_name") %>-error.log @@ -8,8 +9,8 @@ CustomLog ${APACHE_LOG_DIR}/<%= scope.lookupvar("::zuul::vhost_name") %>-access.log combined RewriteEngine on - RewriteRule /zuul/status http://127.0.0.1:8001/status [P] - RewriteRule ^/$ http://127.0.0.1:8001/status [P] + RewriteRule ^/zuul/status$ http://127.0.0.1:8001/status [P] + RewriteRule ^/status.json$ http://127.0.0.1:8001/status.json [P] Alias /rechecks.html /var/www/recheckwatch/rechecks.html