Commit 57ac5fe99fd7c870f1b408ccebbd01960f514636
1 parent
2d3b6375
Exists in
master
and in
4 other branches
Procfile added. use foreman start to run gitlabhq
Showing
5 changed files
with
19 additions
and
2 deletions
Show diff stats
... | ... | @@ -0,0 +1 @@ |
1 | +port: 9999 | ... | ... |
app/controllers/hooks_controller.rb
... | ... | @@ -29,6 +29,15 @@ class HooksController < ApplicationController |
29 | 29 | end |
30 | 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 | 41 | def show |
33 | 42 | @hook = @project.web_hooks.find(params[:id]) |
34 | 43 | end | ... | ... |
app/views/hooks/show.html.haml
1 | 1 | = render "repositories/head" |
2 | -= debug @hook | |
2 | +%h3= @hook.url | |
3 | 3 | |
4 | 4 | - if can? current_user, :admin_project, @project |
5 | 5 | .merge-tabs |
6 | + = link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "grey-button" | |
6 | 7 | .right |
7 | 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 | 85 | end |
86 | 86 | |
87 | 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 | 93 | resources :commits |
90 | 94 | resources :team_members |
91 | 95 | resources :issues do | ... | ... |