Skip to content
Open
Show file tree
Hide file tree
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
18 changes: 17 additions & 1 deletion .ci/pipelines/openshift-ci-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,23 @@ main() {
log::info "Log file: ${LOGFILE}"
log::info "JOB_NAME : $JOB_NAME"

CHART_VERSION=$(get_chart_version "$CHART_MAJOR_VERSION")
if [[ -n "${CHART_VERSION:-}" ]]; then
log::info "Using preset CHART_VERSION (pinned or from env): ${CHART_VERSION}"
elif [[ "${TAG_NAME:-}" =~ ^[0-9]+\.[0-9]+-[0-9]+$ ]]; then
# The image and the chart are published together under the same build
# number, so a pinned TAG_NAME already determines the chart. Resolving the
# newest chart here instead would pair a pinned RC image with a chart from
# a later build.
CHART_VERSION="${TAG_NAME}-CI"
log::info "Derived CHART_VERSION from pinned TAG_NAME: ${CHART_VERSION}"
elif [[ "${TAG_NAME:-}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
# A GA verification pins the image to x.y.z and passes no --chart-version.
# The chart repo publishes the same x.y.z tag, so map it straight across.
CHART_VERSION="${TAG_NAME}"
log::info "Derived CHART_VERSION from pinned GA TAG_NAME: ${CHART_VERSION}"
else
CHART_VERSION=$(get_chart_version "$CHART_MAJOR_VERSION")
fi
export CHART_VERSION

case "$JOB_NAME" in
Expand Down
2 changes: 1 addition & 1 deletion .ci/pipelines/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1510,7 +1510,7 @@ get_previous_release_version() {
get_chart_version() {
local chart_major_version=$1
curl -sSX GET "https://quay.io/api/v1/repository/rhdh/chart/tag/?onlyActiveTags=true&filter_tag_name=like:${chart_major_version}-" -H "Content-Type: application/json" \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add comment explaining that chart_major_version is actually in the form x.y (major.minor or stream) ?

| jq '.tags[0].name' | grep -oE '[0-9]+\.[0-9]+-[0-9]+-CI'
| jq -r '[.tags[] | select(.name | test("^[0-9]+\\.[0-9]+-[0-9]+-CI$"))] | max_by(.start_ts) | .name // empty'
}

# Helper function to get dynamic value file path based on previous release version
Expand Down
Loading