@@ -0,0 +1,2425 @@
+#!/usr/bin/env python%0A# Copyright 2013 OpenStack Foundation%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A#      http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A# License for the specific language governing permissions and limitations%0A# under the License.%0A%0A# This script can be used to manually trigger a job in the same way that%0A# Zuul does.  At the moment, it only supports the post set of Zuul%0A# parameters.%0A%0Aimport argparse%0Aimport time%0Aimport json%0Afrom uuid import uuid4%0A%0Aimport gear%0A%0A%0Adef main():%0A    c = gear.Client()%0A%0A    parser = argparse.ArgumentParser(description='Trigger a Zuul job.')%0A    parser.add_argument('--job', dest='job', required=True,%0A                        help='Job Name')%0A    parser.add_argument('--project', dest='project', required=True,%0A                        help='Project name')%0A    parser.add_argument('--pipeline', dest='pipeline', default='release',%0A                        help='Zuul pipeline')%0A    parser.add_argument('--refname', dest='refname',%0A                        help='Ref name')%0A    parser.add_argument('--oldrev', dest='oldrev',%0A                        default='0000000000000000000000000000000000000000',%0A                        help='Old revision (SHA)')%0A    parser.add_argument('--newrev', dest='newrev',%0A                        help='New revision (SHA)')%0A    args = parser.parse_args()%0A%0A    data = %7B'ZUUL_PIPELINE': args.pipeline,%0A            'ZUUL_PROJECT': args.project,%0A            'ZUUL_UUID': str(uuid4().hex),%0A            'ZUUL_REF': args.refname,%0A            'ZUUL_REFNAME': args.refname,%0A            'ZUUL_OLDREV': args.oldrev,%0A            'ZUUL_NEWREV': args.newrev,%0A            'ZUUL_SHORT_OLDREV': args.oldrev%5B:7%5D,%0A            'ZUUL_SHORT_NEWREV': args.newrev%5B:7%5D,%0A            'ZUUL_COMMIT': args.newrev,%0A            %7D%0A%0A    c.addServer('127.0.0.1', 4730)%0A    c.waitForServer()%0A%0A    job = gear.Job(%22build:%25s%22 %25 args.job,%0A                   json.dumps(data),%0A                   unique=data%5B'ZUUL_UUID'%5D)%0A    c.submitJob(job)%0A%0A    while not job.complete:%0A        time.sleep(1)%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add manual job triggering script.