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

Fix/additional debug info #1915

Merged
merged 3 commits into from
Aug 28, 2024
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
8 changes: 6 additions & 2 deletions scripts/cloudbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ def generate_body(template_target, name, branch, options, remoteCacheStrategy):
if response.status_code == 200 or response.status_code == 201:
# Override target ENV
os.environ['TARGET'] = new_target_name
print("Copying to TARGET env var. {new_target_name}")
elif response.status_code == 500 and 'Build target name already in use for this project!' in response.text:
print('Target update failed due to a possible race condition. Retrying...')
time.sleep(2) # Add a small delay before retrying
Expand All @@ -115,8 +116,11 @@ def set_parameters(params):
'TEST_ENV_GIT': 'workflowDefault'
}
body = hardcoded_params | params
response = requests.put(f'{URL}/buildtargets/{os.getenv('TARGET')}/envvars', headers=HEADERS, json=body)

url = f'{URL}/buildtargets/{os.getenv("TARGET")}/envvars'
print(f"Request URL: {url}")

response = requests.put(url, headers=HEADERS, json=body)

if response.status_code == 200:
print("Parameters set successfully. Response:", response.json())
else:
Expand Down
Loading