diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-03-06 14:33:44 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-03-06 14:33:44 +0200 |
commit | 4622015e43c3d63083be33e8d7d1c5a461ca6aa2 (patch) | |
tree | 812303a1ac68c03637ee83e5b6c57b8c57813b0b | |
parent | 7c1bccc498132aa474dea7189ce08df00131f9aa (diff) | |
download | ick-4622015e43c3d63083be33e8d7d1c5a461ca6aa2.tar.gz |
Require project entries to specify dput targets
This removes the hardcoded target.
-rw-r--r-- | icklib/project.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/icklib/project.py b/icklib/project.py index c3d0f39..c20ba8b 100644 --- a/icklib/project.py +++ b/icklib/project.py @@ -52,6 +52,7 @@ class Project(object): self.commands = [] self.local_commands = [] self.env = {} + self.dput_targets = [] self.pipelines = {} @@ -70,6 +71,9 @@ class Project(object): def add_local_command(self, command): self.local_commands.append(command) + def add_dput_target(self, dput_target): + self.dput_targets.append(dput_target) + def set_build_pipelines(self, pipelines): self.pipelines = pipelines @@ -1026,7 +1030,7 @@ class UploadDebianPackagesToCIRepo(icklib.BuildStep): class PublishDebianPackages(icklib.BuildStep): def build(self): - if not self.run_state.changes_files: + if not self.run_state.changes_files or not self.project.dput_targets: return self.run_state.progress['step'] = ( @@ -1069,8 +1073,11 @@ class PublishDebianPackages(icklib.BuildStep): def _dput(self, tempdir): files = self._changes_files(tempdir) - self.project.run_locally( - ['dput', 'foo'] + files, 'dput foo *.changes', tempdir) + for dput_target in self.project.dput_targets: + self.project.run_locally( + ['dput', dput_target] + files, + 'dput {} *.changes'.format(dput_target), + tempdir) class LineLogger(object): # pragma: no cover @@ -1186,6 +1193,11 @@ def create_projects_from_ick(ick, wanted_names): p.add_shell_command(project_dict['shell']) if 'local-shell' in project_dict: p.add_local_command(project_dict['local-shell']) + if 'debian-release' in project_dict: + release = project_dict['debian-release'] + dput_targets = release.get('dput-targets', []) + for dput_target in dput_targets: + p.add_dput_target(dput_target) p.set_build_pipelines( dict((x, pipelines[x]) for x in project_dict['pipelines'])) p.set_env(project_dict.get('env', {})) |