Permalink
Browse files

Revert "documentation update"

This reverts commit 86e982d.
  • Loading branch information...
1 parent 86e982d commit cbbe5260501862d08aa7790d150c050f152d153f @elvanja committed Feb 25, 2014
View
@@ -76,12 +76,10 @@ http://your-jenkins-server/gitlab/notify_commit
The procedure is the same as for the build now hook, the difference is that this hook schedules polling of the project, much like the original notifyCommit.
-### Notes
-
-This goes for both hook options:
+Additional notes:
* the project must be configured not to skip notifyCommit
-* parametrized projects can be polled, but subsequent build will use the default parameter values (can't propagate the branch to the polling)
+* parametrized projects can be polled, but subsequent build will use the default parametere values (can't propagate the branch to the polling)
### Delete branch commits
View
@@ -14,6 +14,8 @@
module GitlabWebHook
class Api < Sinatra::Base
+ LOGGER = Logger.getLogger(Api.class.name)
+
get '/ping' do
'Gitlab Web Hook is up and running :-)'
end
@@ -35,31 +37,27 @@ class Api < Sinatra::Base
def process_projects(action)
details = parse_request
messages = details.is_delete_branch_commit? ? ProcessDeleteCommit.new.with(details) : ProcessCommit.new.with(details, action)
- logger.info(messages.join("\n"))
+ LOGGER.info(messages.join("\n"))
messages.join("<br/>")
rescue BadRequestException => e
- logger.warning(e.message)
+ LOGGER.warning(e.message)
status 400
e.message
rescue NotFoundException => e
- logger.warning(e.message)
+ LOGGER.warning(e.message)
status 404
e.message
rescue => e
- logger.log(Level::SEVERE, e.message, e)
+ LOGGER.log(Level::SEVERE, e.message, e)
status 500
e.message
end
def parse_request
details = ParseRequest.new.from(params, request)
- logger.info("gitlab web hook triggered for repo url #{details.repository_url} and #{details.branch} branch")
- logger.info("with payload: #{details.payload}")
+ LOGGER.info("gitlab web hook triggered for repo url #{details.repository_url} and #{details.branch} branch")
+ LOGGER.info("with payload: #{details.payload}")
details
end
-
- def logger
- @logger || Logger.getLogger(self.class.name)
- end
end
end
@@ -13,65 +13,23 @@ class GitlabWebHookRootAction < Jenkins::Model::UnprotectedRootAction
include Jenkins::Model::DescribableNative
include Jenkins::RackSupport
+ LOGGER = Logger.getLogger(GitlabWebHookRootAction.class.name)
+
display_name "Gitlab Web Hook Rotten"
icon nil # we don't need the link in the main navigation
url_path "gitlab"
- describe_as Java.hudson.model.Descriptor, :with => GitlabWebHookRootActionDescriptor
+ attr_accessor :conf_param
def call(env)
- logger.info "=========== GitlabWebHookRootAction ENV ==================="
- logger.info "getDescriptor: #{getDescriptor.inspect}"
- logger.info "descriptor_is: #{self.class.descriptor_is.inspect}"
- #logger.info "conf_param: #{self.class.descriptor_is.conf_param}"
- #logger.info "conf_param: #{GitlabWebHookRootActionDescriptor.newInstance.conf_param}"
- logger.info "env: #{env.inspect}"
+ LOGGER.info "=========== GitlabWebHookRootAction ENV ==================="
+ LOGGER.info conf_param
+ LOGGER.info getDescriptor.inspect
+ LOGGER.info env.inspect
GitlabWebHook::Api.new.call(env)
end
- def logger
- @logger || Logger.getLogger(self.class.name)
- end
+ describe_as Java.hudson.model.Descriptor, :with => GitlabWebHookRootActionDescriptor
end
-#class GitlabWebHookRootActionProxy# < Java.hudson.slaves.NodeProperty
-# include Jenkins::Model::EnvironmentProxy
-# include Jenkins::Model::DescribableProxy
-# proxy_for GitlabWebHookRootAction
-#end
-
Jenkins::Plugin.instance.register_extension(GitlabWebHookRootAction)
-
-#class GitlabWebHookRootAction < Jenkins::Model::UnprotectedRootAction
-# include Jenkins::Model
-# #include Jenkins::Model::DescribableNative
-# include Jenkins::Model::Describable
-# include Jenkins::RackSupport
-#
-# LOGGER = Logger.getLogger(GitlabWebHookRootAction.class.name)
-#
-# display_name "Gitlab Web Hook Rotten"
-# icon nil # we don't need the link in the main navigation
-# url_path "gitlab"
-#
-# class TestDescriptor < Java.hudson.model.Descriptor
-# include Jenkins::Model::Descriptor
-#
-# def isApplicable(targetType)
-# true
-# end
-# end
-#
-# def call(env)
-# LOGGER.info "=========== GitlabWebHookRootAction ENV ==================="
-# LOGGER.info "getDescriptor: #{getDescriptor.inspect}"
-# LOGGER.info "descriptor_is: #{self.class.descriptor_is.inspect}"
-# #LOGGER.info "conf_param: #{self.class.descriptor_is.conf_param}"
-# LOGGER.info "conf_param: #{GitlabWebHookRootActionDescriptor.newInstance.conf_param}"
-# LOGGER.info "env: #{env.inspect}"
-# GitlabWebHook::Api.new.call(env)
-# end
-#
-# #describe_as Java.hudson.model.Descriptor, :with => GitlabWebHookRootActionDescriptor
-# describe_as Java.hudson.model.Descriptor, :with => TestDescriptor
-#end
Oops, something went wrong.

0 comments on commit cbbe526

Please sign in to comment.