Files
alfresco-community-repo/scripts/downloadInstaller.sh
Claudia Agache 9c9af8be1c small fix
2020-10-01 15:42:07 +03:00

16 lines
617 B
Bash

#!/usr/bin/env bash
# fail script immediately on any errors in external commands and print the lines
set -ev
outputFile="$TRAVIS_BUILD_DIR/$2/alf-installer.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$1"
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 $RELEASE_AWS_ACCESS_KEY:${signature}" \
https://${host}$1 -o ${outputFile}