def release_staging_repo(self, repo_id, description='No description', auto_drop_after_release=True,
                             keep_metadata=False):
        if keep_metadata:
            # download list of artifacts
            resp = self._send('content/repositories/{repo_id}/{filelist_path}'.format(repo_id=repo_id,
                                                                                      filelist_path=self._get_filelist_path(repo_id)))

            artifacts = [RemoteArtifact.from_repo_id_and_coordinates(repo_id, coordinates=coords)
                        for coords in resp.text.split('\n')]

            # download metadata for all files
            for artifact in artifacts:
                artifact.metadata = self.get_artifact_metadata(artifact)

            release_repo_id = self._get_target_repository(repo_id)

        data = {'data': {'stagedRepositoryIds': [repo_id], 'description': description,
                         'autoDropAfterRelease': auto_drop_after_release}}
        result = self._send_json('service/local/staging/bulk/promote', data, method='POST')

        if keep_metadata:
            for artifact in artifacts:
                artifact.repo_id = release_repo_id
                self.set_artifact_metadata(artifact, artifact.metadata)

        return result
Releases all contents of a staging repository to a release repository which this staging repository targets.
dataset/ETHPy150Open stardust85/repositorytools/repositorytools/lib/repository.py/NexusProRepositoryClient.release_staging_repo