From 28afd77917612ffed8090902315eaa6485455645 Mon Sep 17 00:00:00 2001 From: Peter Zaoral Date: Fri, 15 Mar 2024 18:10:01 +0100 Subject: [PATCH] Stabilize the quarkus-next build stage (#27684) * edited prepare-quarkus-next.sh in order to add the Quarkus nightly snapshot repository as a plugin repository to avoid multiple "artifacts are not being found" failures Closes #27683 Signed-off-by: Peter Zaoral --- .github/scripts/prepare-quarkus-next.sh | 66 +++++++++++++++++-------- 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/.github/scripts/prepare-quarkus-next.sh b/.github/scripts/prepare-quarkus-next.sh index c34d3e2f7e..97dc200f2c 100755 --- a/.github/scripts/prepare-quarkus-next.sh +++ b/.github/scripts/prepare-quarkus-next.sh @@ -1,28 +1,54 @@ #!/bin/bash set -xeuo pipefail +add_repository() { + local file=$1 + local element=$2 + + local id="sonatype-snapshots" + local name="Sonatype Snapshots" + local url="https://s01.oss.sonatype.org/content/repositories/snapshots/" + + # Decide the tag based on the element + local tag + if [ "$element" = "repository" ]; then + tag="repositories" + elif [ "$element" = "pluginRepository" ]; then + tag="pluginRepositories" + fi + + # Repository to be inserted + local repository="<$element> \ + $id \ + $name \ + $url \ + \ + true \ + daily \ + \ + \ + false \ + \ + " + + # Check if the tag exists in the file + if grep -q "<$tag>" "$file"; then + # Insert the element before the closing tag + sed -i "/<\/$tag>/i $repository" "$file" + else + # If the tag doesn't exist, create it and insert the element + sed -i "/<\/project>/i \ + <$tag> \ + $repository \ + " "$file" + fi +} + git checkout -b new-quarkus-next origin/main -if ! grep -q '' pom.xml; then - sed -i '/<\/project>/i \ - \ - ' pom.xml -fi - -# Insert the element before the closing tag -sed -i '/<\/repositories>/i \ - \ - sonatype-snapshots \ - Sonatype Snapshots \ - https://s01.oss.sonatype.org/content/repositories/snapshots/ \ - \ - true \ - daily \ - \ - \ - false \ - \ - ' pom.xml +add_repository "pom.xml" "repository" +add_repository "quarkus/pom.xml" "pluginRepository" +add_repository "operator/pom.xml" "pluginRepository" ./mvnw -B versions:set-property -Dproperty=quarkus.version -DnewVersion=999-SNAPSHOT ./mvnw -B versions:set-property -Dproperty=quarkus.build.version -DnewVersion=999-SNAPSHOT