1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-26 14:46:14 +01:00

Merge branch 'fix-single-service-run' of https://github.com/cmurphy/osc

Fix "osc service run <service>" so that it takes the parameters from
the _service file if <service> is present in the _service file. Also
document (+ fix) the (undocumented) "osc service <command> <service>"
behavior. This enables, for instance, to run "osc service mr foobar",
which would execute all foobar services with mode "manual" (now, this
also works, if the foobar service is not part of the _service file).
This commit is contained in:
Marcus Huewe 2020-08-04 09:13:07 +02:00
commit 3216a56d08
2 changed files with 11 additions and 8 deletions

View File

@ -6938,18 +6938,20 @@ Please submit there instead, or use --nodevelproject to force direct submission.
osc service COMMAND (inside working copy)
osc service run [SOURCE_SERVICE]
osc service runall
osc service localrun
osc service disabledrun
osc service manualrun [SOURCE_SERVICE]
osc service localrun [SOURCE_SERVICE]
osc service disabledrun [SOURCE_SERVICE]
osc service remoterun [PROJECT PACKAGE]
osc service merge [PROJECT PACKAGE]
osc service wait [PROJECT PACKAGE]
COMMAND can be:
run r run defined services locally, it takes an optional parameter to run only a
run r run defined services with modes "trylocal", "localonly", or no mode set locally, may take an optional parameter to run only a
specified source service. In case parameters exist for this one in _service file
they are used.
runall ra run all services independent of the used mode
manualrun mr run all services with mode "manual"
manualrun mr run all services with mode "manual", may take an optional parameter to run only a
specified source service
remoterun rr trigger a re-run on the server side
merge commits all server side generated files and drops the _service definition
wait waits until the service finishes and returns with an error if it failed

View File

@ -422,10 +422,13 @@ class Serviceinfo:
os.unlink(ent)
allservices = self.services or []
if singleservice and not singleservice in allservices:
service_names = [s['name'] for s in allservices]
if singleservice and singleservice not in service_names:
# set array to the manual specified singleservice, if it is not part of _service file
data = { 'name' : singleservice, 'command' : [ singleservice ], 'mode' : '' }
data = { 'name' : singleservice, 'command' : [ singleservice ], 'mode' : callmode }
allservices = [data]
elif singleservice:
allservices = [s for s in allservices if s['name'] == singleservice]
if not allservices:
# short-circuit to avoid a potential http request in vc_export_env
@ -449,8 +452,6 @@ class Serviceinfo:
ret = 0
for service in allservices:
if callmode != "all":
if singleservice and service['name'] != singleservice:
continue
if service['mode'] == "buildtime":
continue
if service['mode'] == "serveronly" and callmode != "local":