Skip to content

Commit 57ac5fe

Browse files
committed
Procfile added. use foreman start to run gitlabhq
1 parent 2d3b637 commit 57ac5fe

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

.foreman

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
port: 9999

Procfile

+2
Original file line numberDiff line numberDiff line change
@@ -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

+9
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@ def create
2929
end
3030
end
3131

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+
3241
def show
3342
@hook = @project.web_hooks.find(params[:id])
3443
end

app/views/hooks/show.html.haml

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
= render "repositories/head"
2-
= debug @hook
2+
%h3= @hook.url
33

44
- if can? current_user, :admin_project, @project
55
.merge-tabs
6+
= link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "grey-button"
67
.right
78
= link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button"

config/routes.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@
8585
end
8686

8787
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
8993
resources :commits
9094
resources :team_members
9195
resources :issues do

0 commit comments

Comments
 (0)