Commit Graph

20 Commits

Author SHA1 Message Date
Antoine Musso 0c47b4292d Retire the project on OpenDev
It has been migrated to the Jenkins community:
https://github.com/jenkinsci/gearman-plugin/

Depends-On: Ib6010d7ce85a934501c50a53e9ac78dcf74bc403
Change-Id: I0c84db2ad3fbb4d9f0eff793a0159c6ed3a8e25c
2021-05-27 17:23:43 +02:00
Jenkins b879f56ef1 Merge "Update to Jenkins LTS 1.625.3 and fix function registration" 2016-03-18 16:23:36 +00:00
Khai Do a5164d65a4 Update to Jenkins LTS 1.625.3 and fix function registration
Using a newer Jenkins LTS (ver 1.625.3) did not work with the
gearman-plugin. Gearman function registeration wasn't working
correct because Computer.currentComputer()[1] and getInstance()[2]
methods seemed to always return null on initialization of the
plugin. The Jenkins.getActiveInstance method (introduced in
Jenkins-1.589)[3] works more reliably.

[1] http://javadoc.jenkins-ci.org/hudson/model/Node.html#getNodeName()
[2] http://javadoc.jenkins-ci.org/jenkins/model/Jenkins.html#getActiveInstance()
[3] e6c2e16f7a

Change-Id: I1534beda9c39a9d15da4d7b96f17e7b75699a631
2016-01-24 06:14:52 -08:00
Andreas Jaeger 93a7922e07 Remove broken scm section
This repository only accepts changes using review.openstack.org and
not via github.com. Therefore remove scm configuration sections, they
cannot work for publishing any content.

Note that the scm maven plugin for git does not support gerrit,
documentation about supported options is at
http://maven.apache.org/scm/git.html

Change-Id: I369ae18b57910eab269747757a2ff78107f9b3d7
2016-01-05 06:56:12 +01:00
Khai Do 6307ba2225 update to work with Jenkins LTS ver 1.565.3
This change updates the gearman-plugin to build against Jenkins LTS
ver 1.565.3.  This is required to support later versions of Jenkins
because there have been changes to Jenkins events in core.

This change adds the ItemListener to re-register gearman
functions on changes to jenkins projects.  Using the ItemListener is
better because it provides more details on the item that's been
changed and the events are more grandular.  There was also a change
to ComputerListener events (onTemporaryOffline and onTemporaryOnline)
that needed to be handled seperately in this change.  The SaveableListener
is still needed due to a bug in ItemListener.

The most notable change to function registration is that the gearman
plugin will no longer register functions containing a node's self label.

For example:
Assume you have the following setup:
  a node: named 'trusty-slave1' and labeled 'trusty'
  a job: named 'my-job' that targets the 'trusty' label

The gearman plugin used to register the following functions:
'build:my-job', 'build:my-job:trusty' and
'build:my-job:trusty-slave1'

With this update the gearman plugin will only register
'build:my-job' and 'build:my-job:trusty'.  It will no
longer register functions containing the implicit
node name (trusty-slave1).

If your gearman client has been using explicit labels
to execute builds then this change will not affect
your workflow.

Closes-Bug: #1353891
Change-Id: I9e57ec9f24bf303989a4df1fc4f1a0c4b6d001bc
2014-10-15 14:21:08 -07:00
zaro0508 1e2fdcc524 setup version as a parameter
This change will allow us to version and deploy
this project in a similiar manner as python projects.

Add a ${project-version} parameter to allow passing
in version from the command line.

Example:
  mvn clean package -Dproject-version=1.2.3

Change-Id: Idda32b1cd86791d6fdcf659f8d0b695782768a76
2013-06-19 14:32:49 -07:00
zaro0508 a99a015cfa depend on a released version of gearman-java and prepare for a gearman-plugin release
Change-Id: I5058d1964476eb8929914a88b2a095da3c6d71d7
2013-04-25 14:56:56 -07:00
zaro0508 2a9b948f44 update docs
Add more info in section for contributing to the project.  link to
newly created launchpad project https://launchpad.net/gearman

Add/update description of jenkins plugin

Change-Id: I5492123e2edf60d178d145eef420443e1934491d
2013-03-27 14:53:13 -07:00
zaro0508 d52850616f Trivial fix to license and dependency
README.rst
  Was not rendering correctly due to license portion.  Just
  moved it down so that rst file would render correctly on github

pom.xml
  maven handles mockito transitive dependencies so we only need
  to depend on mockito-core instead of mockito-all.

Change-Id: I125bd88fec66f843ccc8f1863ed6d1803513405b
2013-03-26 10:00:42 -07:00
zaro0508 2b175701d2 add new unit tests for plugin
This commit adds a few unit tests for the gearman-plugin.
A few things were refactored from creating the tests.
1. move methods from GearmanPluginUtil to GearmanPluginConfig
2. removed a few unused methods.

Change-Id: I8ccd0000ff528867c66958294192818f35d83383
2013-03-20 21:11:27 -07:00
zaro0508 c461e204f2 misc doc and logging updates
Checkin to change README from txt to rst format.
Jenkins seems to hijack logging so i've removed all of the
logging specific bindings that were added previously.
I also added "----" to begining of this plugin's logging
messages so i could easily keep track of them.

Change-Id: Ibd8c56af5b9ad18152bcb0d3ff0c41168a6d2fd1
2013-03-12 10:51:24 -07:00
zaro0508 0bf4a7d2ff return status messages to gearman client
This checkin is to return a correct job status messages to the gearman
client.  It wasn't working before due to this gearman-java issue
https://bugs.launchpad.net/gearman-java/+bug/1126496

src/main/java/hudson/plugins/gearman/StartJobWorker.java
src/main/java/hudson/plugins/gearman/StopJobWorker.java
    Updates to return job error, warning, and success results to gearman client.
    Would like to point out that gearman java<->python translation doesn't work quite
    right.  I believe the python implementation of the gearman worker never
    sends exception messages back to the client

src/main/java/hudson/plugins/gearman/example/StartJobClient.py
src/main/java/hudson/plugins/gearman/example/StopJobClient.py
    Update examples to show how to extract messages

pom.xml
    Updated developer info

Change-Id: Ie8d82be8a8e7c34bc368efda953d5ddfb9547e01
2013-03-08 13:36:34 -08:00
zaro ac1d57e4bf fix plugin extension point, enhanced jelly script, added test connection button
.classpath
  Added eclipse classpath to web resources

pom.xml
  Update jenkins dependency to ver 1.502

src/main/java/hudson/plugins/gearman/Constants.java
  Added default setting for launchWorker configuration.

src/main/java/hudson/plugins/gearman/GearmanPluginConfig.java
  This plugin was extending the wrong jenkins extension point.
  It's now extending GlobalConfiguration instead of Builder which I
  believe is more correct. I had to rename GearmanPlugin to GearmanPluginConfig
  because for some reason extending GlobalConfiguration from a GearmanPlugin
  class doesn't work. Also had to rename the associated jelly script from
  global.jelly to config.jelly

  Moved and renamed help files to let jenkins framework load help files named help-$field.html

src/main/java/hudson/plugins/gearman/ManagementWorkerThread.java
  changed debugging from System.out to logger.info

src/main/resources/hudson/plugins/gearman/GearmanPluginConfig/config.jelly
  Added basic verification for host config (make it required).
  Changed port config type from textbox to number and added basic verification (make it a required number)
  Added a 'Test Connection' button to test the Gearman server connection.
  Remove references to help files to let the jenkins framework load help files named help-$field.html

src/main/resources/index.jelly
  Update description

Change-Id: If0a521c8611d6a93f0434000452dc8c284f5fd74
2013-03-01 10:40:56 -08:00
zaro b734f0cd21 Fix to register all projects and register an additional gearman function for each project.
Jenkins.getProjects() wasn't returning maven and multi-config projects.
This change now attempts to register all projects.  The only caveat
is that the multi-config projects don't get registered quite right
because the labels are treated differently in that project.  I don't
plan to fix multi-config project registration because openstack
doesn't have any of those projects setup in jenkins.

Register an additional function for each executor worker.  We register
a generic "build:$projectName" function on each executor
that can run a build on $projectName.

Minor change, set gearman-plugin version to 'SNAPSHOT'.  The maven
release plugin will convert to a non-SNAPSHOT version on release.

Change-Id: I49a0f73d297e61657fb6f31f26e87c181a644115
2013-02-22 10:29:00 -08:00
Khai Do 8c06c46014 abort running jenkins builds
This checkin will allow a gearman client to request a job to abort a
build that Jenkins is currently running.  The client request needs to
send in the build id to request an abort.  This only aborts builds
that have already made it to jenkins.  It will NOT abort builds that are
still on the gearman queue. Canceling jobs from the gearman queue is a TODO

Added pydev nature due to the example python script added in last commit.
Also setup auto formatting to help remove trailing white spaces.

add additional documentation

set the plugin version starting at 0.0.1

Change-Id: I533934723ee4f4814ebd68c8a2f9fe32a6aef718
2013-02-21 10:17:54 -08:00
Khai Do 6f8a75cd61 switch out logger binding and remove unused file
LabelAssignmentActionImpl.java - removed because it's been replaced by NodeAssignmentAction
pom.xml - switched out SimpleLogger with logback binding
logback.xml - the logback logging configurations.

Change-Id: I17e995df2f5f851051212369bafbfdca65558e98
2013-02-08 15:58:37 -08:00
Khai Do 38788bdf69 threads all plumbed thru
Threads all setup and plumbed thru to get gearman executors and
management works running

Change-Id: I0d6534c18b1dea23c02021afe2f325b03d3e9cb0
2013-01-31 15:11:33 -08:00
Khai Do c5fb8b5e42 Gearman configuration UI is setup in the jenkins config page
Change-Id: I46a03e51b9d2eafdc71a6cdbff46992b82a7c820
2013-01-29 12:05:01 -08:00
Khai Do 76db1c3e95 add pom.xml and gearman-plugin source file.
Added dummy GearmanPlugin.java so that build will pass.
use the apache 2.0 license

Change-Id: I500bc420173a6730c36abf7f12f84eedb8a316d5
2013-01-29 10:09:47 -08:00
Khai Do f04b4f616d setup maven project directories in eclipse
Change-Id: I1a10030051dbaf20a7fb2ac01c350bc8657b92bc
2013-01-11 16:28:22 -08:00