

def release_staging_repo(self, repo_id, description='No description', auto_drop_after_release=True, keep_metadata=False):
    "\n        Releases all contents of a staging repository to a release repository which this staging repository targets.\n\n        :param repo_id: id of staging repository\n        :param description:\n        :param auto_drop_after_release: set this to True if you want to delete the staging repository after releasing\n        :param keep_metadata: Keeps custom maven metadata of artifacts after release. Works only there is list of\n         artifacts created by upload_artifacts_to_new_staging with upload_filelist=False. It is because current Nexus 2.x\n         can't do keep the metadata after release, so we manually read the metadata, release and then set them again.\n        :return:\n        "
    if keep_metadata:
        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')]
        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

dataset/ETHPy150Open stardust85/repositorytools/repositorytools/lib/repository.py NexusProRepositoryClient.release_staging_repo/original