From 235d24c3e7a5318b931fe982fda2ac2580388f9c Mon Sep 17 00:00:00 2001 From: Matthew Blissett Date: Tue, 15 Feb 2022 12:02:42 +0100 Subject: [PATCH] Errors from curl --- src/main/resources/bin/crawl.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/bin/crawl.sh b/src/main/resources/bin/crawl.sh index f98b612..b490ce7 100755 --- a/src/main/resources/bin/crawl.sh +++ b/src/main/resources/bin/crawl.sh @@ -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>/\1/p' > latest.sha1 + curl -Ss -L "${URL}.sha1" | sed -n 's/\(.*\)<\/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 { @@ -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 @@ -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}