diff --git a/.tekton/testing-farm.yaml b/.tekton/testing-farm.yaml index e1ebddf..8d27185 100644 --- a/.tekton/testing-farm.yaml +++ b/.tekton/testing-farm.yaml @@ -136,11 +136,12 @@ spec: IMAGE_URL=quay.io/redhat_emp1/qe-"${IMAGE_NAME}:${IMAGE_TAG}" echo "$IMAGE_URL" if [[ $IMAGE_NAME =~ ^rhel-bootc || $IMAGE_NAME =~ ^centos-bootc || $IMAGE_NAME =~ ^fedora-bootc ]]; then - COMPOSE_ID=$(jq -r '.Labels."redhat.compose-id"' skopeo_inspect.json) - if [[ "${COMPOSE_ID}" == "RHEL-"* ]]; then - COMPOSE=$(echo "${COMPOSE_ID}" | grep -o '^RHEL-[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*')-Nightly - elif [[ "${COMPOSE_ID}" == "CentOS-Stream-"* ]]; then - COMPOSE=$(echo "${COMPOSE_ID}" | grep -o '^CentOS-Stream-[0-9][0-9]*') + REDHAT_ID=$(jq -r '.Labels.redhat.id' skopeo_inspect.json) + REDHAT_VERSION_ID=$(jq -r '.Labels."redhat.version-id"' skopeo_inspect.json) + if [[ "${REDHAT_ID}" == "rhel" ]]; then + COMPOSE=RHEL-${REDHAT_VERSION_ID}.0-Nightly + elif [[ "${REDHAT_ID}" == "centos" ]]; then + COMPOSE=CentOS-Stream-${REDHAT_VERSION_ID} else COMPOSE=Fedora-Rawhide fi diff --git a/anaconda.sh b/anaconda.sh index 47e3544..79f8165 100755 --- a/anaconda.sh +++ b/anaconda.sh @@ -76,10 +76,10 @@ case "$REDHAT_ID" in "rhel") # work with old TEST_OS variable value rhel-9-x TEST_OS=$(echo "${REDHAT_ID}-${REDHAT_VERSION_ID}" | sed 's/\./-/') - sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee rhel-9-y.repo > /dev/null + sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_BATCH_COMPOSE/${BATCH_COMPOSE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee rhel-9-y.repo > /dev/null ADD_REPO="COPY rhel-9-y.repo /etc/yum.repos.d/rhel-9-y.repo" ADD_RHC="RUN dnf install -y rhc" - BOOT_LOCATION="http://${DOWNLOAD_NODE}/rhel-9/composes/RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/${ARCH}/os/" + BOOT_LOCATION="http://${DOWNLOAD_NODE}/rhel-9/nightly/${BATCH_COMPOSE}RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/${ARCH}/os/" OS_VARIANT="rhel9-unknown" BOOT_ARGS="uefi" CUT_DIRS=8 diff --git a/bib-image.sh b/bib-image.sh index 1309445..22afea1 100755 --- a/bib-image.sh +++ b/bib-image.sh @@ -49,7 +49,7 @@ case "$REDHAT_ID" in TEST_IMAGE_URL="quay.io/redhat_emp1/${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" LOCAL_IMAGE_URL="localhost/${TEST_IMAGE_NAME}:${QUAY_REPO_TAG}" SSH_USER="cloud-user" - sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee "${LAYERED_DIR}"/rhel-9-y.repo > /dev/null + sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_BATCH_COMPOSE/${BATCH_COMPOSE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee "${LAYERED_DIR}"/rhel-9-y.repo > /dev/null ADD_REPO="COPY rhel-9-y.repo /etc/yum.repos.d/rhel-9-y.repo" ADD_RHC="RUN dnf install -y rhc" if [[ "$PLATFORM" == "aws" ]]; then @@ -62,12 +62,12 @@ case "$REDHAT_ID" in yum_repos: rhel-9y-baseos: name: rhel-9y-baseos - baseurl: http://${DOWNLOAD_NODE}/rhel-9/composes/RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/\$basearch/os/ + baseurl: http://${DOWNLOAD_NODE}/rhel-9/nightly/${BATCH_COMPOSE}RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/\$basearch/os/ enabled: true gpgcheck: false rhel-9y-appstream: name: rhel-9y-appstream - baseurl: http://${DOWNLOAD_NODE}/rhel-9/composes/RHEL-9/${CURRENT_COMPOSE_ID}/compose/AppStream/\$basearch/os/ + baseurl: http://${DOWNLOAD_NODE}/rhel-9/nightly/${BATCH_COMPOSE}RHEL-9/${CURRENT_COMPOSE_ID}/compose/AppStream/\$basearch/os/ enabled: true gpgcheck: false EOF diff --git a/files/rhel-9-y.template b/files/rhel-9-y.template index 43d5288..aa2745e 100644 --- a/files/rhel-9-y.template +++ b/files/rhel-9-y.template @@ -1,10 +1,10 @@ [rhel-9.y-baseos] -baseurl=http://REPLACE_ME/rhel-9/composes/RHEL-9/REPLACE_COMPOSE_ID/compose/BaseOS/$basearch/os/ +baseurl=http://REPLACE_ME/rhel-9/nightly/REPLACE_BATCH_COMPOSERHEL-9/REPLACE_COMPOSE_ID/compose/BaseOS/$basearch/os/ enabled=1 gpgcheck=0 [rhel-9.y-appstream] -baseurl=http://REPLACE_ME/rhel-9/composes/RHEL-9/REPLACE_COMPOSE_ID/compose/AppStream/$basearch/os/ +baseurl=http://REPLACE_ME/rhel-9/nightly/REPLACE_BATCH_COMPOSERHEL-9/REPLACE_COMPOSE_ID/compose/AppStream/$basearch/os/ enabled=1 gpgcheck=0 diff --git a/os-replace.sh b/os-replace.sh index 7adddc9..4187159 100755 --- a/os-replace.sh +++ b/os-replace.sh @@ -35,7 +35,7 @@ case "$REDHAT_ID" in # work with old TEST_OS variable value rhel-9-x TEST_OS=$(echo "${REDHAT_ID}-${REDHAT_VERSION_ID}" | sed 's/\./-/') SSH_USER="cloud-user" - sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee "${LAYERED_DIR}"/rhel-9-y.repo > /dev/null + sed "s/REPLACE_ME/${DOWNLOAD_NODE}/; s/REPLACE_BATCH_COMPOSE/${BATCH_COMPOSE}/; s/REPLACE_COMPOSE_ID/${CURRENT_COMPOSE_ID}/" files/rhel-9-y.template | tee "${LAYERED_DIR}"/rhel-9-y.repo > /dev/null ADD_REPO="COPY rhel-9-y.repo /etc/yum.repos.d/rhel-9-y.repo" ADD_RHC="RUN dnf install -y rhc" if [[ "$PLATFORM" == "aws" ]]; then @@ -48,12 +48,12 @@ case "$REDHAT_ID" in yum_repos: rhel-9y-baseos: name: rhel-9y-baseos - baseurl: http://${DOWNLOAD_NODE}/rhel-9/composes/RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/\$basearch/os/ + baseurl: http://${DOWNLOAD_NODE}/rhel-9/nightly/${BATCH_COMPOSE}RHEL-9/${CURRENT_COMPOSE_ID}/compose/BaseOS/\$basearch/os/ enabled: true gpgcheck: false rhel-9y-appstream: name: rhel-9y-appstream - baseurl: http://${DOWNLOAD_NODE}/rhel-9/composes/RHEL-9/${CURRENT_COMPOSE_ID}/compose/AppStream/\$basearch/os/ + baseurl: http://${DOWNLOAD_NODE}/rhel-9/nightly/${BATCH_COMPOSE}RHEL-9/${CURRENT_COMPOSE_ID}/compose/AppStream/\$basearch/os/ enabled: true gpgcheck: false EOF diff --git a/tools/shared_lib.sh b/tools/shared_lib.sh index 728b6fe..0994454 100755 --- a/tools/shared_lib.sh +++ b/tools/shared_lib.sh @@ -69,4 +69,14 @@ function image_inspect { REDHAT_VERSION_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.version-id"') CURRENT_COMPOSE_ID=$(skopeo inspect --tls-verify=false "docker://${TIER1_IMAGE_URL}" | jq -r '.Labels."redhat.compose-id"') fi + if [[ -n ${CURRENT_COMPOSE_ID} ]]; then + if [[ ${CURRENT_COMPOSE_ID} == *-updates-* ]]; then + BATCH_COMPOSE="updates/" + else + BATCH_COMPOSE="" + fi + else + BATCH_COMPOSE="updates/" + CURRENT_COMPOSE_ID=latest-RHEL-$REDHAT_VERSION_ID + fi }