diff --git a/Rakefile b/Rakefile index d5f051f32d6..4bfc61dcdc5 100644 --- a/Rakefile +++ b/Rakefile @@ -45,13 +45,13 @@ task :default => :build desc 'Install the environment to run Jekyll' task :install do system 'bundle install' - exit 0 + exit 1 unless $?.success? end desc 'Update the environment to run Jekyll' task :update do system 'bundle update' - exit 0 + exit 1 unless $?.success? end desc 'Build and preview the site locally in development mode' @@ -61,7 +61,11 @@ task :preview do create_context7_files() system 'bundle install' + exit 1 unless $?.success? + system "#{$use_bundle_exec ? 'bundle exec ' : ''}jekyll serve --host 0.0.0.0 --livereload" or raise "Jekyll build failed" + exit 1 unless $?.success? + end desc 'Build the site for the given environment: development (the default), staging, or production' @@ -70,7 +74,11 @@ task :build, [:environment] do |task, args| run_antora system 'bundle install' + exit 1 unless $?.success? + system "JEKYLL_ENV=#{args[:environment]} bundle exec jekyll build" + exit 1 unless $?.success? + clone_versions create_context7_files() diff --git a/_scripts/create-snapshot-links.sh b/_scripts/create-snapshot-links.sh index 19f9f3f564d..0ec549a7364 100755 --- a/_scripts/create-snapshot-links.sh +++ b/_scripts/create-snapshot-links.sh @@ -16,10 +16,30 @@ update_snapshot_link() { local COMPONENT=$1 local ARTIFACT_ID=$2 local CLASSIFIER=$3 + local MAX_RETRIES=3 + local RETRY_DELAY=5 + + echo "Fetching $COMPONENT metadata" + for ((i=1; i<=MAX_RETRIES; i++)); do + SNAPSHOT_VERSION=$(curl --connect-timeout 10 --max-time 30 --silent -fSL $MAVEN_REPO/$GROUP_ID/$ARTIFACT_ID/$DEBEZIUM_VERSION/maven-metadata.xml | awk -F'<[^>]+>' '/tar.gz<\/extension>/ {getline; print $2; exit}') + + if [[ -n "$SNAPSHOT_VERSION" ]]; then + break + fi + + echo " Attempt $i/$MAX_RETRIES failed for $COMPONENT, retrying" + sleep "$RETRY_DELAY" + RETRY_DELAY=$((RETRY_DELAY * 2)) + done + + if [[ -z "$SNAPSHOT_VERSION" ]]; then + echo "ERROR: Failed to resolve snapshot for $COMPONENT after $MAX_RETRIES retries" + return 1 + fi - SNAPSHOT_VERSION=$(curl --silent -fSL $MAVEN_REPO/$GROUP_ID/$ARTIFACT_ID/$DEBEZIUM_VERSION/maven-metadata.xml | awk -F'<[^>]+>' '/tar.gz<\/extension>/ {getline; print $2; exit}') SNAPSHOT_LINK="$MAVEN_REPO/$GROUP_ID/$ARTIFACT_ID/$DEBEZIUM_VERSION/$ARTIFACT_ID-${SNAPSHOT_VERSION}${CLASSIFIER}.tar.gz" sed -i "s#link-$COMPONENT-snapshot:.*#link-$COMPONENT-snapshot: \'$SNAPSHOT_LINK\'#" $ANTORA_FILE + echo "Updated $COMPONENT as $SNAPSHOT_LINK" } for CONNECTOR in "${CONNECTORS[@]}"; do