Add publish function for BuildList
This commit is contained in:
parent
2aae25a41b
commit
02a9a46b60
|
@ -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]
|
||||
|
||||
|
@ -26,6 +26,13 @@ class BuildListsController < ApplicationController
|
|||
@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])
|
||||
@item.status = params[:status]
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
# coding: UTF-8
|
||||
|
||||
class PlatformsController < ApplicationController
|
||||
before_filter :authenticate_user!
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# coding: UTF-8
|
||||
|
||||
class UserMailer < ActionMailer::Base
|
||||
default :from => APP_CONFIG['no-reply-email']
|
||||
|
||||
|
|
|
@ -82,6 +82,11 @@ class BuildList < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def publish
|
||||
BuildServer.publish_container bs_id
|
||||
self.delete
|
||||
end
|
||||
|
||||
private
|
||||
def set_default_status
|
||||
self.status = WAITING_FOR_RESPONSE unless self.status.present?
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -23,6 +23,9 @@ Rosa::Application.routes.draw do
|
|||
get :recent
|
||||
post :filter
|
||||
end
|
||||
member do
|
||||
post :publish
|
||||
end
|
||||
end
|
||||
|
||||
member do
|
||||
|
|
Loading…
Reference in New Issue