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

ci: Integrate UATs to full-bundle-tests.yaml #739

Merged
merged 16 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
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
33 changes: 33 additions & 0 deletions scripts/get_release_from_bundle_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Get bundle test path for specific release
import os
import re
import sys

def get_release_from_bundle_source() -> None:
if len(sys.argv) <= 1:
raise Exception("No bundle source given as input.")

bundle_source = sys.argv[1]
# Bundle source input should be `--channel <channel_name>` or `--file <bundle_file>.yaml``
# e.g. --channel=1.8/stable or --file=releases/1.8/stable/kubeflow/bundle.yaml
bundle_source_starts_with_channel = re.search("^--channel", bundle_source)
bundle_source_starts_with_file = re.search("^--file", bundle_source)

try:
if bundle_source_starts_with_channel:
substrings = bundle_source.split('=')
NohaIhab marked this conversation as resolved.
Show resolved Hide resolved
release=substrings[1]
elif bundle_source_starts_with_file:
substrings = bundle_source.split('/')
track = substrings[1]
risk = substrings[2]
release = f"{track}/{risk}"
print(
f"Returning release={release}.")
except:
raise Exception("Bundle source doesn't have expected format.")

with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'release={release}', file=fh)

get_release_from_bundle_source()