summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-04-27 14:43:27 +0300
committerLars Wirzenius <liw@liw.fi>2018-04-27 15:11:22 +0300
commitd7418614ef0433e00e081a040f9ccb26882d8b39 (patch)
tree7c87daca30a6e1139ec2777e93fab188b6bce801
parentbfa6476104848546320d1e2e9b7217f0d0312a68 (diff)
downloadick2-d7418614ef0433e00e081a040f9ccb26882d8b39.tar.gz
Add: dput action
-rw-r--r--NEWS4
-rw-r--r--ick2/actions.py16
2 files changed, 20 insertions, 0 deletions
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'])