summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-08 12:20:24 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-08 12:20:24 +0200
commit57ac5fe99fd7c870f1b408ccebbd01960f514636 (patch)
tree41e30f77e996de6b98a5e0b1c165ecaf30e506ca
parent2d3b6375f38ac6e3a14fad93f243c258d74b0331 (diff)
downloadgitlab-ce-57ac5fe99fd7c870f1b408ccebbd01960f514636.tar.gz
Procfile added. use foreman start to run gitlabhq
-rw-r--r--.foreman1
-rw-r--r--Procfile2
-rw-r--r--app/controllers/hooks_controller.rb9
-rw-r--r--app/views/hooks/show.html.haml3
-rw-r--r--config/routes.rb6
5 files changed, 19 insertions, 2 deletions
diff --git a/.foreman b/.foreman
new file mode 100644
index 00000000000..549e85b1490
--- /dev/null
+++ b/.foreman
@@ -0,0 +1 @@
+port: 9999
diff --git a/Procfile b/Procfile
new file mode 100644
index 00000000000..2f73f49416d
--- /dev/null
+++ b/Procfile
@@ -0,0 +1,2 @@
+web: bundle exec rails s -p $PORT
+worker: bundle exec rake environment resque:work QUEUE=*
diff --git a/app/controllers/hooks_controller.rb b/app/controllers/hooks_controller.rb
index 9205a6a6f67..7c5f7631f4e 100644
--- a/app/controllers/hooks_controller.rb
+++ b/app/controllers/hooks_controller.rb
@@ -29,6 +29,15 @@ class HooksController < ApplicationController
end
end
+ def test
+ @hook = @project.web_hooks.find(params[:id])
+ commits = @project.commits(@project.default_branch, nil, 3)
+ data = @project.web_hook_data(commits.last.id, commits.first.id, "refs/heads/#{@project.default_branch}")
+ @hook.execute(data)
+
+ redirect_to :back
+ end
+
def show
@hook = @project.web_hooks.find(params[:id])
end
diff --git a/app/views/hooks/show.html.haml b/app/views/hooks/show.html.haml
index 56b5fa9d3a1..6bc1132de27 100644
--- a/app/views/hooks/show.html.haml
+++ b/app/views/hooks/show.html.haml
@@ -1,7 +1,8 @@
= render "repositories/head"
-= debug @hook
+%h3= @hook.url
- if can? current_user, :admin_project, @project
.merge-tabs
+ = link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "grey-button"
.right
= link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
diff --git a/config/routes.rb b/config/routes.rb
index 5f129c904d0..9d1e7089209 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -85,7 +85,11 @@ Gitlab::Application.routes.draw do
end
resources :snippets
- resources :hooks, :only => [:index, :new, :create, :destroy, :show]
+ resources :hooks, :only => [:index, :new, :create, :destroy, :show] do
+ member do
+ get :test
+ end
+ end
resources :commits
resources :team_members
resources :issues do