def push_operator_manifest(self, repo, version, source_dir): """Build, verify and push operators artifact to quay.io registry If organization is "public=True" this method ensures that repo will be published. :param repo: name of repository :param version: release version :param source_dir: path to directory with manifests """ try: courier_api.build_verify_and_push(self._organization, repo, version, self._token, source_dir=source_dir) except Exception as e: self._handle_courier_exception(e) else: if not self.public: self.logger.info( "Organization '%s' is private, skipping publishing", self._organization) return if not self.oauth_access: self.logger.error( "Cannot publish repository %s, Oauth access is not " "configured for organization %s", repo, self._organization) return self.publish_repo(repo)
def push(self): parser = argparse.ArgumentParser( description='Build, verify and push an operator bundle ' 'into external app registry.') parser.add_argument( 'source_dir', help='Path of your directory of yaml files to bundle.') parser.add_argument( 'namespace', help='Name of the Quay namespace to push operator to.') parser.add_argument('repository', help='Application repository name ' 'the application is bundled for.') parser.add_argument('release', help='The release version of the bundle.') parser.add_argument('token', help='Authorization token for Quay api.') parser.add_argument( '--validation-output', dest='validation_output', help='A file to write validation warnings and errors to' 'in JSON format') args, leftovers = parser.parse_known_args(sys.argv[2:]) api.build_verify_and_push(args.namespace, args.repository, args.release, args.token, source_dir=args.source_dir, validation_output=args.validation_output)
def push(self, args): """Run the push command """ api.build_verify_and_push(args.namespace, args.repository, args.release, args.token, source_dir=args.source_dir, validation_output=args.validation_output)