From c62f64c7046bcd7b5f81a48f5051fe8d63b3ce2d Mon Sep 17 00:00:00 2001 From: Claudia Agache Date: Wed, 8 Jul 2020 14:10:04 +0300 Subject: [PATCH] Merge pull request #1167 from Alfresco/feature-2.7/APPS-235_SetupEnv_no Apps 235 Setup environment (cherry picked from commit 23cddd2753588cdd89b8abc4782202c34046acf3) --- .travis.yml | 25 +++++++++++- rm-automation/pom.xml | 78 ++++++++++++++++++++++++++++++++++++ scripts/downloadInstaller.sh | 15 +++++++ travis-env-vars.yml | 5 +++ 4 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 scripts/downloadInstaller.sh create mode 100644 travis-env-vars.yml diff --git a/.travis.yml b/.travis.yml index beedfe6331..578c3ad808 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,5 @@ +import: + - source: travis-env-vars.yml os: linux dist: xenial language: java @@ -23,6 +25,9 @@ before_install: - "cp .travis.settings.xml $HOME/.m2/settings.xml" install: skip +services: + - docker + stages: - name: Build AGS - name: Tests @@ -65,21 +70,39 @@ jobs: - echo "Enterprise Integrations Tests on MySQL" - name: "Community Rest API Tests" stage: Tests + before_install: + - travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q + - travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_COMMUNITY_PATH/target + install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-community -q -f $AUTOMATION_COMMUNITY_PATH/pom.xml script: - echo "Community Rest API Tests" +# Uncomment following line to start alfresco env using run-alfresco profile and run the tests. +# Currently commented because running tests is part of APPS-236 task +# travis_wait 90 mvn -B install -Prun-alfresco -Dskip.automationtests=false -f $AUTOMATION_COMMUNITY_PATH/pom.xml - name: "Enterprise Rest API Tests" stage: Tests + before_install: + - travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q + - travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_ENTERPRISE_PATH/target + install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-enterprise -q -f $AUTOMATION_ENTERPRISE_PATH/pom.xml script: - echo "Enterprise Rest API Tests" - name: "Community UI Tests ..." stage: Tests + before_install: + - travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q + - travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_UI_PATH/target + install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-community -q -f $AUTOMATION_UI_PATH/pom.xml script: - echo "Community UI Tests ..." - name: "Enterprise UI Tests ..." stage: Tests + before_install: + - travis_retry travis_wait 90 mvn -B install -Dmaven.javadoc.skip=true -Dmaven.source.skip=true -DskipTests -q + - travis_wait 5 bash scripts/downloadInstaller.sh $AUTOMATION_UI_PATH/target + install: travis_wait 20 mvn -B install -PinstallAlfresco,apply-rm-enterprise -q -f $AUTOMATION_UI_PATH/pom.xml script: - echo "Enterprise UI Tests ..." - - name: "Source Clear Scan (SCA)" stage: Security Scans script: diff --git a/rm-automation/pom.xml b/rm-automation/pom.xml index c53b4de142..01d198864a 100644 --- a/rm-automation/pom.xml +++ b/rm-automation/pom.xml @@ -90,6 +90,7 @@ + install-alfresco @@ -130,6 +131,83 @@ + + + installAlfresco + + + + io.fabric8 + docker-maven-plugin + 0.31.0 + + + start-postgresql + generate-test-resources + + start + + + + + test-database + postgres:9.1 + + + 5432:5432 + + + alfresco + alfresco + alfresco + + + -c max_connections=300 + + + database system is ready to accept connections + + + + + + + + + + + + maven-antrun-plugin + + + fetch-installer + generate-test-resources + + run + + + + + Installing Alfresco... + + + + + + + + + + + postgresql + postgresql + 9.1-901-1.jdbc4 + + + + + + apply-rm-community diff --git a/scripts/downloadInstaller.sh b/scripts/downloadInstaller.sh new file mode 100644 index 0000000000..31812860f5 --- /dev/null +++ b/scripts/downloadInstaller.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# fail script immediately on any errors in external commands and print the lines +set -ev + +outputFile="$TRAVIS_BUILD_DIR/$1/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${S3_INSTALLER_PATH}" +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}${S3_INSTALLER_PATH} -o ${outputFile} diff --git a/travis-env-vars.yml b/travis-env-vars.yml new file mode 100644 index 0000000000..da5c33ff9f --- /dev/null +++ b/travis-env-vars.yml @@ -0,0 +1,5 @@ +env: + global: + - AUTOMATION_COMMUNITY_PATH=rm-automation/rm-automation-community-rest-api + - AUTOMATION_ENTERPRISE_PATH=rm-automation/rm-automation-enterprise-rest-api + - AUTOMATION_UI_PATH=rm-automation/rm-automation-ui