diff --git a/src/main/java/hudson/plugins/gearman/example/StartJobClient.py b/src/main/java/hudson/plugins/gearman/example/StartJobClient.py deleted file mode 100644 index 7f7d5f3..0000000 --- a/src/main/java/hudson/plugins/gearman/example/StartJobClient.py +++ /dev/null @@ -1,49 +0,0 @@ -''' - - Copyright 2013 Hewlett-Packard Development Company, L.P. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -''' - -''' - A python example of how to start a jenkins job using a Gearman client - - author: Khai Do -''' - - - -from gearman import GearmanClient -import simplejson -import uuid - -server = '127.0.0.1:4730' -client = GearmanClient([server]) -function = 'build:pep8:precise' -build_id = uuid.uuid4().hex -build_params = {'param1':"red", 'param2':"white", 'param3':"blue"} - -# Submit a synchronous job request to the job server -print 'Sending job ' + build_id + ' to ' + server + ' with params ' + str(build_params) -request = client.submit_job(function, - simplejson.dumps(build_params), - poll_timeout=60, - unique=build_id) - -if (request.exception) : - print request.exception -else: - print ', '.join(request.warning_updates) - print request.result - print 'Work complete with state %s' % request.state diff --git a/src/main/java/hudson/plugins/gearman/example/StopJobClient.py b/src/main/java/hudson/plugins/gearman/example/StopJobClient.py deleted file mode 100644 index 85cb0e7..0000000 --- a/src/main/java/hudson/plugins/gearman/example/StopJobClient.py +++ /dev/null @@ -1,48 +0,0 @@ -''' - - Copyright 2013 Hewlett-Packard Development Company, L.P. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - -''' - -''' - A python example of how to stop a jenkins job using a Gearman client - - author: Khai Do -''' - -from gearman import GearmanClient -import simplejson -import uuid - -server = '127.0.0.1' -port = '4730' -conn = server + ":" + port -client = GearmanClient([conn]) -function = "stop:" + server -build_id = uuid.UUID('{5ac10210-0405-0607-4809-1a0b0c0d0e0f}').hex - -# Submit a synchronous job request to the job server -print 'Sending job ' + function + ' to ' + conn + ' with id ' + build_id -request = client.submit_job(function, - "", - poll_timeout=60, - unique=build_id) - -if (request.exception) : - print request.exception -else: - print ', '.join(request.warning_updates) - print request.result - print 'Work complete with state %s' % request.state