mirror of
https://github.com/docker/compose.git
synced 2025-07-20 12:14:41 +02:00
Fix release script
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
156ce2bc1d
commit
e8af19daa3
@ -58,8 +58,11 @@ def create_bump_commit(repository, release_branch, bintray_user, bintray_org):
|
|||||||
repository.push_branch_to_remote(release_branch)
|
repository.push_branch_to_remote(release_branch)
|
||||||
|
|
||||||
bintray_api = BintrayAPI(os.environ['BINTRAY_TOKEN'], bintray_user)
|
bintray_api = BintrayAPI(os.environ['BINTRAY_TOKEN'], bintray_user)
|
||||||
print('Creating data repository {} on bintray'.format(release_branch.name))
|
if not bintray_api.repository_exists(bintray_org, release_branch.name):
|
||||||
bintray_api.create_repository(bintray_org, release_branch.name, 'generic')
|
print('Creating data repository {} on bintray'.format(release_branch.name))
|
||||||
|
bintray_api.create_repository(bintray_org, release_branch.name, 'generic')
|
||||||
|
else:
|
||||||
|
print('Bintray repository {} already exists. Skipping'.format(release_branch.name))
|
||||||
|
|
||||||
|
|
||||||
def monitor_pr_status(pr_data):
|
def monitor_pr_status(pr_data):
|
||||||
|
@ -29,6 +29,16 @@ class BintrayAPI(requests.Session):
|
|||||||
result.raise_for_status()
|
result.raise_for_status()
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def repository_exists(self, subject, repo_name):
|
||||||
|
url = '{base}/repos/{subject}/{repo_name}'.format(
|
||||||
|
base=self.base_url, subject=subject, repo_name=repo_name,
|
||||||
|
)
|
||||||
|
result = self.get(url)
|
||||||
|
if result.status_code == 404:
|
||||||
|
return False
|
||||||
|
result.raise_for_status()
|
||||||
|
return True
|
||||||
|
|
||||||
def delete_repository(self, subject, repo_name):
|
def delete_repository(self, subject, repo_name):
|
||||||
url = '{base}/repos/{subject}/{repo_name}'.format(
|
url = '{base}/repos/{subject}/{repo_name}'.format(
|
||||||
base=self.base_url, subject=subject, repo_name=repo_name,
|
base=self.base_url, subject=subject, repo_name=repo_name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user