Skip to content

Commit

Permalink
Use GitHub mirror to download pom.xml
Browse files Browse the repository at this point in the history
git.opendaylight.org returns '410 Gone' when User-Agent of curl or wget
is used. To work around the issue this patch changes Gerrit gitweb to
GitHub OpenDaylgiht mirror to download pom.xml.

Change-Id: Ia9d4c10dce76d01f8bc0d2531f45d7cd426a2832
Signed-off-by: Sangwook Ha <[email protected]>
  • Loading branch information
sangwookha-vz committed Nov 5, 2024
1 parent be695e3 commit 00ba590
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion jjb/autorelease/update-autorelease-projects-views.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if [[ ! "$resp" =~ $BRANCH ]]; then
BRANCH="master"
fi

wget -nv -O /tmp/pom.xml "https://git.opendaylight.org/gerrit/gitweb?p=releng/autorelease.git;a=blob_plain;f=pom.xml;hb=$GERRIT_BRANCH"
wget -nv -O /tmp/pom.xml "https://github.com/opendaylight/releng-autorelease/raw/refs/heads/$GERRIT_BRANCH/pom.xml"

# handle list of projects read from the pom.xml output as multiple lines.
mapfile -t modules < <(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' /tmp/pom.xml)
Expand Down
2 changes: 1 addition & 1 deletion jjb/autorelease/update-validate-autorelease-projects.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [[ ! "$resp" =~ $BRANCH ]]; then
BRANCH="master"
fi

wget -nv -O /tmp/pom.xml "https://git.opendaylight.org/gerrit/gitweb?p=releng/autorelease.git;a=blob_plain;f=pom.xml;hb=$GERRIT_BRANCH"
wget -nv -O /tmp/pom.xml "https://github.com/opendaylight/releng-autorelease/raw/refs/heads/$GERRIT_BRANCH/pom.xml"
# Allow word splitting as we only expect modules to appear
# shellcheck disable=2207
modules=($(xmlstarlet sel -N x=http://maven.apache.org/POM/4.0.0 -t -m '//x:modules' -v '//x:module' /tmp/pom.xml))
Expand Down
20 changes: 10 additions & 10 deletions jjb/integration/integration-compare-distributions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@
# Do not fail the build if there is trouble trying to collect distribution patch diffs
set +e

NEXUSURL_PREFIX=${ODLNEXUSPROXY:-https://nexus.opendaylight.org}
ODL_NEXUS_REPO=${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}
GERRIT_PATH=${GERRIT_PATH:-git.opendaylight.org/gerrit}
DISTROBRANCH=${DISTROBRANCH:-$GERRIT_BRANCH}
NEXUSURL_PREFIX="${ODLNEXUSPROXY:-https://nexus.opendaylight.org}"
ODL_NEXUS_REPO="${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}"
GITHUB_PATH="${GITHUB_PATH:-github.com/opendaylight}"
DISTROBRANCH="${DISTROBRANCH:-$GERRIT_BRANCH}"

# Obtain current pom.xml of integration/distribution, correct branch.
if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=opendaylight/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/opendaylight/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "netconf-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/karaf/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "controller-test-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/karaf/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "bgpcep-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=distribution-karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/distribution-karaf/pom.xml"
else
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/pom.xml"
fi

# Extract the BUNDLE_VERSION from the pom.xml
Expand Down
14 changes: 7 additions & 7 deletions jjb/integration/integration-detect-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
# TODO: Document the default values.
NEXUSURL_PREFIX="${ODLNEXUSPROXY:-https://nexus.opendaylight.org}"
ODL_NEXUS_REPO="${ODL_NEXUS_REPO:-content/repositories/opendaylight.snapshot}"
GERRIT_PATH="${GERRIT_PATH:-git.opendaylight.org/gerrit}"
GITHUB_PATH="${GITHUB_PATH:-github.com/opendaylight}"
DISTROBRANCH="${DISTROBRANCH:-$GERRIT_BRANCH}"

if [ "${BUNDLE_URL}" == 'last' ]; then
# Obtain current pom.xml of integration/distribution, correct branch.
if [[ "$KARAF_ARTIFACT" == "opendaylight" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=opendaylight/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/opendaylight/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "netconf-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/karaf/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "controller-test-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/karaf/pom.xml"
elif [[ "$KARAF_ARTIFACT" == "bgpcep-karaf" ]]; then
wget "http://${GERRIT_PATH}/gitweb?p=${KARAF_PROJECT}.git;a=blob_plain;f=distribution-karaf/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/$KARAF_PROJECT/raw/refs/heads/$DISTROBRANCH/distribution-karaf/pom.xml"
else
wget "http://${GERRIT_PATH}/gitweb?p=integration/distribution.git;a=blob_plain;f=pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://$GITHUB_PATH/integration-distribution/raw/refs/heads/$DISTROBRANCH/pom.xml"
fi
# Extract the BUNDLE_VERSION from the pom.xml
# TODO: remove the second xpath command once the old version in CentOS 7 is not used any more
Expand Down
2 changes: 1 addition & 1 deletion jjb/integration/multipatch-distribution.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mkdir -p "$BUILD_DIR"
cd "$BUILD_DIR"

# Download distribution pom.xml
wget "https://git.opendaylight.org/gerrit/gitweb?p=integration/distribution.git;a=blob_plain;f=artifacts/upstream/properties/pom.xml;hb=refs/heads/$DISTROBRANCH" -O "pom.xml"
wget -nv -O pom.xml "https://github.com/opendaylight/integration-distribution/raw/refs/heads/$DISTROBRANCH/artifacts/upstream/properties/pom.xml"
cat pom.xml

# Set up git committer name and email, needed for commit creation when cherry-picking.
Expand Down

0 comments on commit 00ba590

Please sign in to comment.