Merge branch 'master' of github.com:warpc/rosa-build
This commit is contained in:
commit
02ac46019a
|
@ -17,6 +17,9 @@ class BuildListsController < ApplicationController
|
|||
end
|
||||
@action_url = all_build_lists_path
|
||||
|
||||
@build_server_status = BuildServer.get_status
|
||||
#@build_server_status = {:client_count => '1', :count_new_task => '2', :count_build_task => 3}
|
||||
|
||||
render :action => 'index'
|
||||
end
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ class CategoriesController < ApplicationController
|
|||
def index
|
||||
if @platform
|
||||
@categories = Category.joins(:projects => :repositories).where('repositories.platform_id = ?', @platform.id).
|
||||
having('count(projects.id) > 0').group('categories.id').default_order
|
||||
having('count(projects.id) > 0').group('categories.id, categories.name, categories.ancestry, categories.projects_count, categories.created_at, categories.updated_at').default_order
|
||||
@categories_count = @categories.count
|
||||
render 'index2'
|
||||
else
|
||||
|
|
|
@ -58,8 +58,8 @@ class ProjectsController < ApplicationController
|
|||
|
||||
def build
|
||||
@arches = Arch.recent
|
||||
@pls = Platform.main
|
||||
@bpls = @project.repositories.collect { |rep| ["#{rep.platform.name}/#{rep.unixname}", rep.platform.id] }
|
||||
@bpls = Platform.main
|
||||
@pls = @project.repositories.collect { |rep| ["#{rep.platform.name}/#{rep.unixname}", rep.platform.id] }
|
||||
@project_versions = @project.project_versions.collect { |tag| [tag.name, tag.name.gsub(/^\w+\./, "")] }.select { |pv| pv[0] =~ /^v\./ }
|
||||
end
|
||||
|
||||
|
@ -69,10 +69,10 @@ class ProjectsController < ApplicationController
|
|||
|
||||
@project_version = params[:build][:project_version]
|
||||
|
||||
pls_ids = params[:build][:pl].blank? ? [] : params[:build][:pl].select{|_,v| v == "1"}.collect{|x| x[0].to_i }
|
||||
pls = Platform.where(:id => pls_ids)
|
||||
bpls_ids = params[:build][:bpl].blank? ? [] : params[:build][:bpl].select{|_,v| v == "1"}.collect{|x| x[0].to_i }
|
||||
bpls = Platform.where(:id => bpls_ids)
|
||||
|
||||
bpl = Platform.find params[:build][:bpl]
|
||||
pl = Platform.find params[:build][:pl]
|
||||
update_type = params[:build][:update_type]
|
||||
build_requires = params[:build][:build_requires]
|
||||
|
||||
|
@ -80,20 +80,20 @@ class ProjectsController < ApplicationController
|
|||
|
||||
if !check_arches || !check_project_versions
|
||||
@arches = Arch.recent
|
||||
@pls = Platform.main
|
||||
@bpls = @project.repositories.collect { |rep| ["#{rep.platform.name}/#{rep.unixname}", rep.platform.id] }
|
||||
@bpls = Platform.main
|
||||
@pls = @project.repositories.collect { |rep| ["#{rep.platform.name}/#{rep.unixname}", rep.platform.id] }
|
||||
|
||||
render :action => "build"
|
||||
else
|
||||
flash[:notice], flash[:error] = "", ""
|
||||
@arches.each do |arch|
|
||||
pls.each do |pl|
|
||||
bpls.each do |bpl|
|
||||
build_list = @project.build_lists.new(:arch => arch, :project_version => @project_version, :pl => pl, :bpl => bpl, :update_type => update_type, :build_requires => build_requires)
|
||||
|
||||
if build_list.save
|
||||
flash[:notice] += t("flash.build_list.saved", :project_version => @project_version, :arch => arch.name, :pl => pl.name, :bpl => bpl)
|
||||
flash[:notice] += t("flash.build_list.saved", :project_version => @project_version, :arch => arch.name, :bpl => bpl.name, :pl => pl)
|
||||
else
|
||||
flash[:error] += t("flash.build_list.save_error", :project_version => @project_version, :arch => arch.name, :pl => pl.name, :bpl => bpl)
|
||||
flash[:error] += t("flash.build_list.save_error", :project_version => @project_version, :arch => arch.name, :bpl => bpl.name, :pl => pl)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ class BuildList < ActiveRecord::Base
|
|||
validates :update_type, :inclusion => UPDATE_TYPES
|
||||
|
||||
validate lambda {
|
||||
errors.add(:pl, I18n.t('flash.build_list.wrong_platform')) if bpl.platform_type == 'main' && pl_id != bpl_id
|
||||
errors.add(:bpl, I18n.t('flash.build_list.wrong_platform')) if pl.platform_type == 'main' && pl_id != bpl_id
|
||||
}
|
||||
|
||||
BUILD_CANCELED = 5000
|
||||
|
|
|
@ -41,7 +41,7 @@ class User < ActiveRecord::Base
|
|||
create_ssh_key ssh_key
|
||||
elsif ssh_key_was.present? and ssh_key.blank?
|
||||
destroy_ssh_key ssh_key_was
|
||||
elsif ssh_key_changed?
|
||||
elsif ssh_key_changed? and ssh_key.present? and ssh_key_was.present?
|
||||
update_ssh_key ssh_key_was, ssh_key
|
||||
end
|
||||
}
|
||||
|
|
|
@ -6,6 +6,18 @@
|
|||
%li.active= link_to t("layout.build_lists.all"), project_build_lists_path(@project)
|
||||
|
||||
.content
|
||||
- if controller.action_name == 'all'
|
||||
.inner
|
||||
%h2= t('layout.build_lists.build_server_status.header')
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.client_count') + ":"
|
||||
%span= @build_server_status[:client_count]
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.count_new_task') + ":"
|
||||
%span= @build_server_status[:count_new_task]
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.count_build_task') + ":"
|
||||
%span= @build_server_status[:count_build_task]
|
||||
|
||||
.inner
|
||||
= render :partial => "build_lists/filter", :action_url => @action_url
|
||||
|
|
|
@ -22,6 +22,26 @@
|
|||
= t("activerecord.attributes.build_list.container_path")
|
||||
\:
|
||||
= @build_list.container_path
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.build_list.bpl")
|
||||
\:
|
||||
= @build_list.bpl.name
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.build_list.pl")
|
||||
\:
|
||||
= @build_list.pl.name
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.build_list.update_type")
|
||||
\:
|
||||
= @build_list.update_type
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.build_list.build_requires")
|
||||
\:
|
||||
= @build_list.build_requires
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.build_list.status")
|
||||
|
|
|
@ -19,10 +19,10 @@
|
|||
= f.select :project_version, @project_versions
|
||||
|
||||
.group.pl_ids_container
|
||||
= f.label :pl, t("activerecord.attributes.build_list.pl"), :class => :label
|
||||
- @pls.each do |pl|
|
||||
= f.check_box "pl[#{pl.id}]", :pl_id => pl.id, :class => 'build_pl_ids'
|
||||
= pl.name
|
||||
= f.label :bpl, t("activerecord.attributes.build_list.bpl"), :class => :label
|
||||
- @bpls.each do |bpl|
|
||||
= f.check_box "bpl[#{bpl.id}]", :bpl_id => bpl.id, :class => 'build_bpl_ids'
|
||||
= bpl.name
|
||||
%br
|
||||
|
||||
.group
|
||||
|
@ -43,8 +43,8 @@
|
|||
%br
|
||||
|
||||
.group
|
||||
= f.label :bpl, t("activerecord.attributes.build_list.bpl"), :class => :label
|
||||
= f.select :bpl, @bpls
|
||||
= f.label :pl, t("activerecord.attributes.build_list.pl"), :class => :label
|
||||
= f.select :pl, @pls
|
||||
|
||||
.group.navform.wat-cf
|
||||
%button.button{:type => "submit"}
|
||||
|
|
|
@ -229,6 +229,12 @@ ru:
|
|||
cancel_successed: 'Сборка отменена.'
|
||||
cancel_failed: 'При отмене сборки произошла ошибка!'
|
||||
|
||||
build_server_status:
|
||||
header: Статус сборочного сервера
|
||||
client_count: Число клиентов
|
||||
count_new_task: Число заданий в очереди
|
||||
count_build_task: Число выполняемых заданий
|
||||
|
||||
items:
|
||||
statuses:
|
||||
build_error: ошибка сборки
|
||||
|
@ -305,8 +311,8 @@ ru:
|
|||
destroyed: Платформа успешно удалена
|
||||
|
||||
build_list:
|
||||
saved: Билд лист для версии '%{project_version}', платформу '%{pl}' и архитектуры '%{arch}' создан успешно
|
||||
save_error: Не удалось сохранить билд лист для версии '%{project_version}', платформу '%{pl}' и архитектуры '%{arch}'
|
||||
saved: Билд лист для версии '%{project_version}', платформы '%{bpl}' и архитектуры '%{arch}' создан успешно
|
||||
save_error: Не удалось сохранить билд лист для версии '%{project_version}', платформы '%{bpl}' и архитектуры '%{arch}'
|
||||
no_project_version_selected: Выберите какую-нибудь версию
|
||||
no_project_version_found: Выбранная версия '%{project_version}' не найдена
|
||||
no_arch_selected: Выберите хотя бы одну ахритектуру
|
||||
|
@ -465,10 +471,10 @@ ru:
|
|||
additional_repos: Дополнительные репозитории
|
||||
updated_at: Обновлен
|
||||
created_at: Создан
|
||||
bpl: Репозиторий для сохранения пакетов
|
||||
bpl_id: Репозиторий для сохранения пакетов
|
||||
pl: Платформа
|
||||
pl_id: Платформа
|
||||
pl: Репозиторий для сохранения пакетов
|
||||
pl_id: Репозиторий для сохранения пакетов
|
||||
bpl: Платформа
|
||||
bpl_id: Платформа
|
||||
update_type: Критичность обновления
|
||||
build_requires: Пересборка с зависимостями
|
||||
project_version: Версия
|
||||
|
|
|
@ -76,6 +76,10 @@ class BuildServer
|
|||
self.client.call('delete_build_list', idlist)
|
||||
end
|
||||
|
||||
def get_status
|
||||
self.client.call('get_status')
|
||||
end
|
||||
|
||||
def self.freeze platform_name, new_repo_name = nil
|
||||
self.client.call('freeze_platform', platform_name, new_repo_name)
|
||||
end
|
||||
|
|
|
@ -15,26 +15,26 @@ function uncheck_by_ids(ids) {
|
|||
$(document).ready(function() {
|
||||
$('.pl_ids_container input[type="hidden"]').remove();
|
||||
|
||||
$('select#build_bpl').change(function() {
|
||||
var is_bpl_main = false;
|
||||
var granted_pl_id = '';
|
||||
var bpl_id = $('select#build_bpl').val();
|
||||
$('select#build_pl').change(function() {
|
||||
var is_pl_main = false;
|
||||
var granted_bpl_id = '';
|
||||
var pl_id = $('select#build_pl').val();
|
||||
|
||||
$('input.build_pl_ids').each(function(i,el) {
|
||||
var pl_id = $(el).attr('pl_id');
|
||||
$('input.build_bpl_ids').each(function(i,el) {
|
||||
var bpl_id = $(el).attr('bpl_id');
|
||||
if (pl_id == bpl_id) {
|
||||
is_bpl_main = true;
|
||||
//granted_pl_id = $(el).attr('pl_id');
|
||||
is_pl_main = true;
|
||||
//granted_bpl_id = $(el).attr('bpl_id');
|
||||
}
|
||||
});
|
||||
|
||||
if (is_bpl_main) {
|
||||
$('input.build_pl_ids').attr('disabled', 'disabled');
|
||||
$('input.build_pl_ids[pl_id="'+bpl_id+'"]').removeAttr('disabled');
|
||||
if (is_pl_main) {
|
||||
$('input.build_bpl_ids').attr('disabled', 'disabled');
|
||||
$('input.build_bpl_ids[bpl_id="'+pl_id+'"]').removeAttr('disabled');
|
||||
} else {
|
||||
$('input.build_pl_ids').removeAttr('disabled');
|
||||
$('input.build_bpl_ids').removeAttr('disabled');
|
||||
}
|
||||
});
|
||||
|
||||
$('select#build_bpl').trigger('change');
|
||||
$('select#build_pl').trigger('change');
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue