code: def run(self):
          
          # Only run if the build was successful
          if self.workflow.build_process_failed:
              self.log.info("Not promoting failed build to koji")
              return
  
          self.koji_session = get_koji_session(self.workflow, self.koji_fallback)
          koji_metadata, output_files = self.get_metadata()
  
          try:
              server_dir = self.get_upload_server_dir()
              for output in output_files:
                  if output.file:
                      self.upload_file(self.koji_session, output, server_dir)
          finally:
              for output in output_files:
                  if output.file:
                      output.file.close()
  
          try:
              build_info = self.koji_session.CGImport(koji_metadata, server_dir)
          except Exception:
              self.log.debug("metadata: %r", koji_metadata)
              raise
  
          # Older versions of CGImport do not return a value.
          build_id = build_info.get("id") if build_info else None
  
          self.log.debug("Build information: %s",
                         json.dumps(build_info, sort_keys=True, indent=4))
  
          # If configured, koji_tag_build plugin will perform build tagging
          tag_later = are_plugins_in_order(self.workflow.exit_plugins_conf,
                                           PLUGIN_KOJI_PROMOTE_PLUGIN_KEY,
                                           PLUGIN_KOJI_TAG_BUILD_KEY)
          if not tag_later and build_id is not None and self.target is not None:
              tag_koji_build(self.koji_session, build_id, self.target,
                             poll_interval=self.poll_interval)
  
          return build_id
docs: Run the plugin.