Add publish function for BuildList

This commit is contained in:
Vladimir Sharshov 2011-09-15 21:56:20 +04:00
parent 2aae25a41b
commit 02a9a46b60
8 changed files with 26 additions and 4 deletions

View File

@ -1,9 +1,9 @@
class BuildListsController < ApplicationController
before_filter :authenticate_user!, :except => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
before_filter :authenticate_build_service!, :only => [:status_build, :pre_build, :post_build, :circle_build, :new_bbdt]
before_filter :find_platform, :only => [:index, :filter, :show]
before_filter :find_repository, :only => [:index, :filter, :show]
before_filter :find_project, :only => [:index, :filter, :show]
before_filter :find_platform, :only => [:index, :filter, :show, :publish]
before_filter :find_repository, :only => [:index, :filter, :show, :publish]
before_filter :find_project, :only => [:index, :filter, :show, :publish]
before_filter :find_arches, :only => [:index, :filter]
before_filter :find_branches, :only => [:index, :filter]
@ -25,6 +25,13 @@ class BuildListsController < ApplicationController
@build_list = @project.build_lists.find(params[:id])
@item_groups = @build_list.items.group_by_level
end
def publish
@build_list = @project.build_lists.find(params[:id])
@build_list.publish
redirect_to platform_repository_project_build_lists_path(@platform, @repository, @project)
end
def status_build
@item = @build_list.items.find_by_name!(params[:package_name])

View File

@ -1,3 +1,4 @@
# coding: UTF-8
class PlatformsController < ApplicationController
before_filter :authenticate_user!

View File

@ -1,3 +1,5 @@
# coding: UTF-8
class UserMailer < ActionMailer::Base
default :from => APP_CONFIG['no-reply-email']

View File

@ -81,6 +81,11 @@ class BuildList < ActiveRecord::Base
end
end
end
def publish
BuildServer.publish_container bs_id
self.delete
end
private
def set_default_status

View File

@ -1,4 +1,4 @@
require 'lib/build_server.rb'
#require 'lib/build_server.rb'
class Platform < ActiveRecord::Base
belongs_to :parent, :class_name => 'Platform', :foreign_key => 'parent_platform_id'
has_many :repositories, :dependent => :destroy

View File

@ -58,6 +58,8 @@
= t("activerecord.attributes.build_list.additional_repos")
\:
= @build_list.additional_repos
.wat-cf
= link_to image_tag("web-app-theme/icons/cross.png", :alt => t("layout.publish")) + " " + t("layout.publish"), publish_platform_repository_project_build_list(@platform, @repository, @project, @build_list), :method => "post", :class => "button", :confirm => t("layout.build_lists.confirm_publish")
.block
.content

View File

@ -19,6 +19,7 @@ ru:
no_: Нет
true_: Да
false_: Нет
publish: Опубликовать
weekdays:
Monday: Понедельник
@ -143,6 +144,7 @@ ru:
items_header: Элементы сборки
no_items_data: Данных нет
show: Просмотр
confirm_publish: Вы уверены, что хотите опубликовать контейнер?
items:
statuses:

View File

@ -23,6 +23,9 @@ Rosa::Application.routes.draw do
get :recent
post :filter
end
member do
post :publish
end
end
member do