From 9cd75d90d34472273c517b80d53553a099e1415d Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Mon, 6 Jul 2020 17:37:48 +0300 Subject: [PATCH] try to fix output file --- scripts/downloadInstaller.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/downloadInstaller.sh b/scripts/downloadInstaller.sh index 20068fc1ab..97274e81ef 100644 --- a/scripts/downloadInstaller.sh +++ b/scripts/downloadInstaller.sh @@ -2,19 +2,15 @@ # fail script immediately on any errors in external commands and print the lines set -ev -outputFile=$HOME/rm-automation -amzFile="release/enterprise/5.2/5.2.7/5.2.7.4/alfresco-content-services-installer-5.2.7.4-linux-x64.bin" -region="eu-west-1" -bucket="eu.dl.alfresco.com" -resource="/${bucket}/${amzFile}" +outputFile=$HOME/rm-automation/alfresco-content-services-installer-5.2.7.4-linux-x64.bin +amzFile="/eu.dl.alfresco.com/release/enterprise/5.2/5.2.7/5.2.7.4/alfresco-content-services-installer-5.2.7.4-linux-x64.bin" +host="s3-eu-west-1.amazonaws.com" contentType="binary/octet-stream" dateValue=`TZ=GMT date -R` -stringToSign="GET\n\n${contentType}\n${dateValue}\n${resource}" -s3Key=$RELEASE_AWS_ACCESS_KEY -s3Secret=$RELEASE_AWS_SECRET_KEY -signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${s3Secret} -binary | base64` -curl -H "Host: s3-${region}.amazonaws.com" \ +stringToSign="GET\n\n${contentType}\n${dateValue}\n${amzFile}" +signature=`echo -en ${stringToSign} | openssl sha1 -hmac $RELEASE_AWS_SECRET_KEY -binary | base64` +curl -H "Host: ${host}" \ -H "Date: ${dateValue}" \ -H "Content-Type: ${contentType}" \ - -H "Authorization: AWS ${s3Key}:${signature}" \ - https://s3-${region}.amazonaws.com/${bucket}/${amzFile} -o ${outputFile} + -H "Authorization: AWS $RELEASE_AWS_ACCESS_KEY:${signature}" \ + https://${host}${amzFile} -o ${outputFile}