GitLabCi Service imtegration
This commit is contained in:
parent
8500743464
commit
406a0c809b
16 changed files with 158 additions and 7 deletions
37
app/controllers/services_controller.rb
Normal file
37
app/controllers/services_controller.rb
Normal file
|
@ -0,0 +1,37 @@
|
|||
class ServicesController < ProjectResourceController
|
||||
# Authorize
|
||||
before_filter :authorize_admin_project!
|
||||
|
||||
respond_to :html
|
||||
|
||||
def index
|
||||
@gitlab_ci_service = @project.gitlab_ci_service
|
||||
end
|
||||
|
||||
def edit
|
||||
@service = @project.gitlab_ci_service
|
||||
|
||||
# Create if missing
|
||||
@service = @project.create_gitlab_ci_service unless @service
|
||||
end
|
||||
|
||||
def update
|
||||
@service = @project.gitlab_ci_service
|
||||
|
||||
if @service.update_attributes(params[:service])
|
||||
redirect_to :back
|
||||
else
|
||||
render 'edit'
|
||||
end
|
||||
end
|
||||
|
||||
def test
|
||||
commits = project.commits(project.default_branch, nil, 3)
|
||||
data = project.post_receive_data(commits.last.id, commits.first.id, "refs/heads/#{project.default_branch}", current_user)
|
||||
|
||||
@service = project.gitlab_ci_service
|
||||
@service.execute(data)
|
||||
|
||||
redirect_to :back
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue