def push_image_to_providers(self, image_id, build_id, providers, credentials, job_cls = BuildJob, *args, **kwargs): if not build_id: build_id = self._latest_unpushed(image_id) watcher = PushWatcher(image_id, build_id, len(providers), self.warehouse) jobs = [] for provider in providers: target = Provider.map_provider_to_target(provider) target_image_id = self._target_image_for_build_and_target(build_id, target) template = self._template_for_target_image_id(target_image_id) job = job_cls(template, target, image_id, build_id, *args, **kwargs) job.push_image(target_image_id, provider, credentials, watcher) jobs.append(job) self.job_registry.register(jobs) return jobs