From b5c6edea3233561bd67f87edd24c05a810b7df4e Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Mon, 6 Jul 2020 16:56:49 +0300 Subject: [PATCH] try to download installer from s3 --- .travis.yml | 1 + rm-automation/pom.xml | 10 +++++----- scripts/downloadInstaller.sh | 20 ++++++++++++++++++++ 3 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 scripts/downloadInstaller.sh diff --git a/.travis.yml b/.travis.yml index bbbfb72a19..7e5ffd0a7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,6 +62,7 @@ jobs: - echo "Enterprise Integrations Tests on MySQL" - name: "Community Rest API Tests" stage: Tests + before_install: travis_wait 90 bash scripts/downloadInstaller.sh install: - travis_wait 90 bash scripts/startAlfresco.sh apply-rm-community script: diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index 5508471f2f..3883f759c4 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -147,14 +147,14 @@ Recreating database... drop database if exists alfresco; create database alfresco - Downloading Alfresco installer... - - + + + Installing Alfresco... - + - + diff --git a/scripts/downloadInstaller.sh b/scripts/downloadInstaller.sh new file mode 100644 index 0000000000..40391287da --- /dev/null +++ b/scripts/downloadInstaller.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# 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}" +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" \ + -H "Date: ${dateValue}" \ + -H "Content-Type: ${contentType}" \ + -H "Authorization: AWS ${s3Key}:${signature}" \ + https://s3-${region}.amazonaws.com/${bucket}/${amzFile} -o $outputFile