Skip to content

Commit

Permalink
Procfile added. use foreman start to run gitlabhq
Browse files Browse the repository at this point in the history
  • Loading branch information
dzaporozhets committed Jan 8, 2012
1 parent 2d3b637 commit 57ac5fe
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
1 change: 1 addition & 0 deletions .foreman
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
port: 9999
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: bundle exec rails s -p $PORT
worker: bundle exec rake environment resque:work QUEUE=*
9 changes: 9 additions & 0 deletions app/controllers/hooks_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ def create
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
Expand Down
3 changes: 2 additions & 1 deletion app/views/hooks/show.html.haml
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 5 additions & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@
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
Expand Down

0 comments on commit 57ac5fe

Please sign in to comment.