Commit 57ac5fe99fd7c870f1b408ccebbd01960f514636

Authored by Dmitriy Zaporozhets
1 parent 2d3b6375

Procfile added. use foreman start to run gitlabhq

.foreman 0 → 100644
@@ -0,0 +1 @@ @@ -0,0 +1 @@
  1 +port: 9999
Procfile 0 → 100644
@@ -0,0 +1,2 @@ @@ -0,0 +1,2 @@
  1 +web: bundle exec rails s -p $PORT
  2 +worker: bundle exec rake environment resque:work QUEUE=*
app/controllers/hooks_controller.rb
@@ -29,6 +29,15 @@ class HooksController < ApplicationController @@ -29,6 +29,15 @@ class HooksController < ApplicationController
29 end 29 end
30 end 30 end
31 31
  32 + def test
  33 + @hook = @project.web_hooks.find(params[:id])
  34 + commits = @project.commits(@project.default_branch, nil, 3)
  35 + data = @project.web_hook_data(commits.last.id, commits.first.id, "refs/heads/#{@project.default_branch}")
  36 + @hook.execute(data)
  37 +
  38 + redirect_to :back
  39 + end
  40 +
32 def show 41 def show
33 @hook = @project.web_hooks.find(params[:id]) 42 @hook = @project.web_hooks.find(params[:id])
34 end 43 end
app/views/hooks/show.html.haml
1 = render "repositories/head" 1 = render "repositories/head"
2 -= debug @hook 2 +%h3= @hook.url
3 3
4 - if can? current_user, :admin_project, @project 4 - if can? current_user, :admin_project, @project
5 .merge-tabs 5 .merge-tabs
  6 + = link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "grey-button"
6 .right 7 .right
7 = link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button" 8 = link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
config/routes.rb
@@ -85,7 +85,11 @@ Gitlab::Application.routes.draw do @@ -85,7 +85,11 @@ Gitlab::Application.routes.draw do
85 end 85 end
86 86
87 resources :snippets 87 resources :snippets
88 - resources :hooks, :only => [:index, :new, :create, :destroy, :show] 88 + resources :hooks, :only => [:index, :new, :create, :destroy, :show] do
  89 + member do
  90 + get :test
  91 + end
  92 + end
89 resources :commits 93 resources :commits
90 resources :team_members 94 resources :team_members
91 resources :issues do 95 resources :issues do