Update deployment scripts to support AWSI automation tests on Linux (#7038)

* Update deployment scripts to support AWSI automation tests on Linux

Signed-off-by: Junbo Liang <68558268+junbo75@users.noreply.github.com>
This commit is contained in:
Junbo Liang
2022-01-24 11:20:15 -08:00
committed by GitHub
parent 160508d2d6
commit 1cf7d57b3f
12 changed files with 38 additions and 52 deletions
@@ -185,11 +185,11 @@
"COMMAND": "build_test_linux.sh",
"PARAMETERS": {
"CONFIGURATION": "profile",
"OUTPUT_DIRECTORY": "build\\linux",
"OUTPUT_DIRECTORY": "build/linux",
"CMAKE_OPTIONS": "-G 'Ninja Multi-Config' -DLY_PARALLEL_LINK_JOBS=4",
"CMAKE_LY_PROJECTS": "AutomatedTesting",
"CMAKE_TARGET": "TEST_SUITE_awsi",
"CTEST_OPTIONS": "-L \"(SUITE_awsi)\" --no-tests=error",
"CTEST_OPTIONS": "-L (SUITE_awsi) --no-tests=error",
"TEST_RESULTS": "True"
}
},
@@ -1,5 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
@@ -8,7 +8,7 @@
# Deploy the CDK applications for AWS gems (Linux only)
SOURCE_DIRECTORY=$(dirname "$0")
SOURCE_DIRECTORY=$PWD
PATH=$SOURCE_DIRECTORY/python:$PATH
GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems
@@ -80,11 +80,14 @@ fi
# Set temporary AWS credentials from the assume role
credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session)
AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1)
AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2)
AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3)
export AWS_SECRET_ACCESS_KEY=$(echo $credentials | cut -d' ' -f1)
export AWS_SESSION_TOKEN=$(echo $credentials | cut -d' ' -f2)
export AWS_ACCESS_KEY_ID=$(echo $credentials | cut -d' ' -f3)
O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5)
export O3DE_AWS_DEPLOY_ACCOUNT=$(echo "$ASSUME_ROLE_ARN" | cut -d':' -f5)
if [[ -z "$O3DE_AWS_PROJECT_NAME" ]]; then
export O3DE_AWS_PROJECT_NAME=$BRANCH_NAME-$PIPELINE_NAME-Linux
fi
# Bootstrap and deploy the CDK applications
echo [cdk_bootstrap] Bootstrap CDK
@@ -11,7 +11,7 @@
# 1) Node.js is installed
# 2) Node.js version >= 10.13.0, except for versions 13.0.0 - 13.6.0. A version in active long-term support is recommended.
SOURCE_DIRECTORY=$(dirname "$0")
SOURCE_DIRECTORY=$PWD
PATH=$SOURCE_DIRECTORY/python:$PATH
GEM_DIRECTORY=$SOURCE_DIRECTORY/Gems
@@ -70,12 +70,12 @@ echo [cdk_installation] Install the current version of nodejs
nvm install node
echo [cdk_installation] Install the latest version of CDK
if ! sudo npm uninstall -g aws-cdk;
if ! npm uninstall -g aws-cdk;
then
echo [cdk_bootstrap] Failed to uninstall the current version of CDK
exit 1
fi
if ! sudo npm install -g aws-cdk@latest;
if ! npm install -g aws-cdk@latest;
then
echo [cdk_bootstrap] Failed to install the latest version of CDK
exit 1
@@ -83,9 +83,13 @@ fi
# Set temporary AWS credentials from the assume role
credentials=$(aws sts assume-role --query Credentials.[SecretAccessKey,SessionToken,AccessKeyId] --output text --role-arn $ASSUME_ROLE_ARN --role-session-name o3de-Automation-session)
AWS_SECRET_ACCESS_KEY=$(echo "$credentials" | cut -d' ' -f1)
AWS_SESSION_TOKEN=$(echo "$credentials" | cut -d' ' -f2)
AWS_ACCESS_KEY_ID=$(echo "$credentials" | cut -d' ' -f3)
export AWS_SECRET_ACCESS_KEY=$(echo $credentials | cut -d' ' -f1)
export AWS_SESSION_TOKEN=$(echo $credentials | cut -d' ' -f2)
export AWS_ACCESS_KEY_ID=$(echo $credentials | cut -d' ' -f3)
if [[ -z "$O3DE_AWS_PROJECT_NAME" ]]; then
export O3DE_AWS_PROJECT_NAME=$BRANCH_NAME-$PIPELINE_NAME-Linux
fi
ERROR_EXISTS=0
DestroyCDKApplication AWSCore
@@ -16,13 +16,6 @@
},
"PIPELINE_JENKINS_PARAMETERS": {
"nightly-incremental": [
{
"parameter_name": "O3DE_AWS_PROJECT_NAME",
"parameter_type": "string",
"default_value": "",
"use_last_run_value": true,
"description": "The name of the O3DE project that stacks should be deployed for."
},
{
"parameter_name": "O3DE_AWS_DEPLOY_REGION",
"parameter_type": "string",
@@ -46,13 +39,6 @@
}
],
"nightly-clean": [
{
"parameter_name": "O3DE_AWS_PROJECT_NAME",
"parameter_type": "string",
"default_value": "",
"use_last_run_value": true,
"description": "The name of the O3DE project that stacks should be deployed for."
},
{
"parameter_name": "O3DE_AWS_DEPLOY_REGION",
"parameter_type": "string",
@@ -49,6 +49,10 @@ FOR /f "tokens=1,2,3" %%a IN ('CALL aws sts assume-role --query Credentials.[Sec
)
FOR /F "tokens=4 delims=:" %%a IN ("%ASSUME_ROLE_ARN%") DO SET O3DE_AWS_DEPLOY_ACCOUNT=%%a
IF "%O3DE_AWS_PROJECT_NAME%"=="" (
SET O3DE_AWS_PROJECT_NAME=%BRANCH_NAME%-%PIPELINE_NAME%-Windows
)
REM Bootstrap and deploy the CDK applications
ECHO [cdk_bootstrap] Bootstrap CDK
CALL cdk bootstrap aws://%O3DE_AWS_DEPLOY_ACCOUNT%/%O3DE_AWS_DEPLOY_REGION%
@@ -48,6 +48,9 @@ FOR /f "tokens=1,2,3" %%a IN ('CALL aws sts assume-role --query Credentials.[Sec
SET AWS_ACCESS_KEY_ID=%%c
)
FOR /F "tokens=4 delims=:" %%a IN ("%ASSUME_ROLE_ARN%") DO SET O3DE_AWS_DEPLOY_ACCOUNT=%%a
IF "%O3DE_AWS_PROJECT_NAME%"=="" (
SET O3DE_AWS_PROJECT_NAME=%BRANCH_NAME%-%PIPELINE_NAME%-Windows
)
SET ERROR_EXISTS=0
CALL :DestroyCDKApplication AWSCore,ERROR_EXISTS
@@ -16,13 +16,6 @@
},
"PIPELINE_JENKINS_PARAMETERS": {
"nightly-incremental": [
{
"parameter_name": "O3DE_AWS_PROJECT_NAME",
"parameter_type": "string",
"default_value": "",
"use_last_run_value": true,
"description": "The name of the O3DE project that stacks should be deployed for."
},
{
"parameter_name": "O3DE_AWS_DEPLOY_REGION",
"parameter_type": "string",
@@ -46,13 +39,6 @@
}
],
"nightly-clean": [
{
"parameter_name": "O3DE_AWS_PROJECT_NAME",
"parameter_type": "string",
"default_value": "",
"use_last_run_value": true,
"description": "The name of the O3DE project that stacks should be deployed for."
},
{
"parameter_name": "O3DE_AWS_DEPLOY_REGION",
"parameter_type": "string",