From d7418614ef0433e00e081a040f9ccb26882d8b39 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 27 Apr 2018 14:43:27 +0300 Subject: Add: dput action --- NEWS | 4 ++++ ick2/actions.py | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/NEWS b/NEWS index 44e83e1..4d0cf66 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,10 @@ Version 0.47+git, not yet released * New action to do `rsync -av` from a directory in the workspace to a remote server. +* New action to do `dput *.changes` in the root of the workspace, to + upload Debian packages to the APT repository that is part of an ick + cluster. + Version 0.47, released 2018-04-25 ---------------------------------- diff --git a/ick2/actions.py b/ick2/actions.py index 185f171..4f3358f 100644 --- a/ick2/actions.py +++ b/ick2/actions.py @@ -102,6 +102,7 @@ class ActionFactory: 'create_workspace': CreateWorkspaceAction, 'git': GitAction, 'rsync': RsyncAction, + 'dput': DputAction, } kind = spec['action'] klass = rules2.get(kind) @@ -370,6 +371,21 @@ class RsyncAction(Action): # pragma: no cover return ':' in target +class DputAction(Action): # pragma: no cover + + def encode_parameters(self, params): + pass + + def execute(self, params, step): + env = self.get_env() + workspace = env.get_workspace_directory() + + argv = ['sh', '-c', 'dput ick *.changes'] + exit_code = env.host_runcmd(argv, cwd=workspace) + env.report(exit_code, 'dput finished (exit code %d)\n' % exit_code) + return exit_code + + def make_directory_empty(env, dirname): return env.runcmd( ['sudo', 'find', dirname, '-mindepth', '1', '-delete']) -- cgit v1.2.1