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

add "osc service runall"

This is up for discussion, but I try to simplify the interface here:
- obsolete "localrun" and "disabledrun". Still implemented, but not anymore
  recommended and documented. can hopefully removed later.
- "runall" is running all services local, also buildtime services
  - files get replaced by the service
  - can be used to get final tar balls to be used with tools like quilt
This commit is contained in:
Adrian Schröter 2016-06-01 17:01:34 +02:00
parent 2364a08236
commit 28c12686b9
3 changed files with 22 additions and 18 deletions

4
NEWS
View File

@ -1,5 +1,7 @@
0.155
-
- osc service runall: runs all service local, independend of the mode
This allows to create local files even when disabled or
just created at buildtime
0.154
- switch to new obs_scm service when adding git URL's

View File

@ -6272,8 +6272,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
run r run defined services locally, it takes an optional parameter to run only a
specified source service. In case parameters exist for this one in _service file
they are used.
localrun lr run services locally and store files as local created
disabledrun dr run disabled or server side only services locally and store files as local created
runall ra run all services independend of the used mode
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
@ -6303,7 +6302,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
command = args[0]
if not (command in ( 'run', 'localrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'r', 'rr', 'merge', 'wait' )):
if not (command in ( 'runall', 'ra', 'run', 'localrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'r', 'rr', 'merge', 'wait' )):
raise oscerr.WrongArgs('Wrong command given.')
if command == "remoterun" or command == "rr":
@ -6318,7 +6317,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
print(mergeservice(apiurl, project, package))
return
if command in ('run', 'localrun', 'disabledrun', 'lr', 'dr', 'r'):
if command in ('runall', 'ra', 'run', 'localrun', 'disabledrun', 'lr', 'dr', 'r'):
if not is_package_dir(os.curdir):
raise oscerr.WrongArgs('Local directory is no package')
p = Package(".")
@ -6326,6 +6325,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
mode = "local"
elif command == "disabledrun" or command == "dr":
mode = "disabled"
elif command == "runall" or command == "ra":
mode = "all"
return p.run_source_services(mode, singleservice)

View File

@ -398,6 +398,7 @@ class Serviceinfo:
# recreate files
ret = 0
for service in allservices:
if callmode != "all":
if singleservice and service['name'] != singleservice:
continue
if service['mode'] == "buildtime":
@ -428,7 +429,7 @@ class Serviceinfo:
# updating _services.
return r
if service['mode'] == "disabled" or service['mode'] == "trylocal" or service['mode'] == "localonly" or callmode == "local" or callmode == "trylocal":
if service['mode'] == "disabled" or service['mode'] == "trylocal" or service['mode'] == "localonly" or callmode == "local" or callmode == "trylocal" or callmode == "all":
for filename in os.listdir(temp_dir):
os.rename(os.path.join(temp_dir, filename), os.path.join(dir, filename))
else: