Skip to content

Commit

Permalink
Errors from curl
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBlissett committed Feb 15, 2022
1 parent 2763be5 commit 235d24c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/resources/bin/crawl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ function download {
function downloadJarSha1 {
URL=`getArtifactUrl -s https://repository.gbif.org -g org.gbif.content -a content-crawler -v LATEST -r $1`
echo Download jar sha1 ${URL}.sha1
curl -s -L "${URL}.sha1" | sed -n 's/<sha1>\(.*\)<\/sha1>/\1/p' > latest.sha1
curl -Ss -L "${URL}.sha1" | sed -n 's/<sha1>\(.*\)<\/sha1>/\1/p' > latest.sha1
}

#Download configuration settings from GitHub.
#Receives as parameter the environment/file name to be downloaded.
function downloadConfig {
echo "Get configuration from github"
curl -s -H "Authorization: token $1" -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/gbif/gbif-configuration/contents/content-crawler/$2.yml
curl -Ss --fail -H "Authorization: token $1" -H 'Accept: application/vnd.github.v3.raw' -O -L https://api.github.com/repos/gbif/gbif-configuration/contents/content-crawler/$2.yml
}

function getArtifactUrl {
Expand Down Expand Up @@ -67,13 +67,13 @@ function getArtifactUrl {
if [[ ${VERSION} == "LATEST" || ${VERSION} == *SNAPSHOT* ]] ; then

if [[ "${VERSION}" == "LATEST" ]] ; then
VERSION=$(xmllint --xpath "//metadata/versioning/versions/version[last()]/text()" <(curl -s "${SONAR_REDIRECT_URL}/maven-metadata.xml"))
VERSION=$(xmllint --xpath "//metadata/versioning/versions/version[last()]/text()" <(curl -Ss "${SONAR_REDIRECT_URL}/maven-metadata.xml"))
fi

if [[ "${VERSION}" == *SNAPSHOT* ]] ; then
META_PATH=${SONAR_REDIRECT_URL}/${VERSION}/maven-metadata.xml
TIMESTAMP=`curl -s "${META_PATH}" | xmllint --xpath "string(//timestamp)" -`
BUILD_NUMBER=`curl -s "${META_PATH}" | xmllint --xpath "string(//buildNumber)" -`
TIMESTAMP=`curl -Ss "${META_PATH}" | xmllint --xpath "string(//timestamp)" -`
BUILD_NUMBER=`curl -Ss "${META_PATH}" | xmllint --xpath "string(//buildNumber)" -`

FILENAME=${ARTIFACT_ID}-${VERSION%-SNAPSHOT}-${TIMESTAMP}-${BUILD_NUMBER}${CLASSIFIER}.${PACKAGING}
else
Expand All @@ -83,7 +83,7 @@ function getArtifactUrl {
else

if [[ ${VERSION} == "RELEASE" ]] ; then
VERSION=$(xmllint --xpath "string(//release)" <(curl -s "${SONAR_REDIRECT_URL}/maven-metadata.xml"))
VERSION=$(xmllint --xpath "string(//release)" <(curl -Ss "${SONAR_REDIRECT_URL}/maven-metadata.xml"))
fi

FILENAME=${ARTIFACT_ID}-${VERSION}${CLASSIFIER}.${PACKAGING}
Expand Down

0 comments on commit 235d24c

Please sign in to comment.