Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Release to fail when release isn't triggered properly #158

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions tools/circleci/circleci_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

import os
import sys

import requests
from requests.structures import CaseInsensitiveDict
Expand Down Expand Up @@ -33,12 +34,6 @@ def circleci_release(project_slug, payload, circle_endpoint, circle_release_toke
headers["Circle-Token"] = circle_release_token

resp = requests.post(circle_endpoint, headers=headers, json=payload, timeout=10)
print(f"Status Code: {resp.status_code}")
if resp.status_code == 201:
print("Creating CircleCI Pipeline successfully")
print(resp.content)
else:
print("Failed to create CircleCI Pipeline")
return resp


Expand Down Expand Up @@ -70,6 +65,14 @@ def circleci_release(project_slug, payload, circle_endpoint, circle_release_toke

print(package_name, package_version)
if check_no_version_pypi(pypi_endpoint, package_name, package_version):
circleci_release(
res = circleci_release(
PROJECT_SLUG, payload, circleci_endpoint, CIRCLE_RELEASE_TOKEN
)
print(f"Status Code: {resp.status_code}")
if resp.status_code == 201:
print("Creating CircleCI Pipeline successfully")
else:
print("Failed to create CircleCI Pipeline")
print(resp.content)
if resp.status_code != 201:
sys.exit(1)