forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor-iac-integration-ubuntu.yml
105 lines (85 loc) · 3.72 KB
/
appveyor-iac-integration-ubuntu.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
version: 1.0.{build}
image:
- Ubuntu2004
environment:
AWS_DEFAULT_REGION: us-east-1
SAM_CLI_DEV: 1
NOSE_PARAMETERIZED_NO_WARN: 1
APPVEYOR_CONSOLE_DISABLE_PTY: false
APPVEYOR_DETAILED_SHELL_LOGGING: true
matrix:
- PYTHON_HOME: "$HOME/venv3.7/bin"
PYTHON_VERSION: '3.7'
- PYTHON_HOME: "$HOME/venv3.8/bin"
PYTHON_VERSION: '3.8'
- PYTHON_HOME: "$HOME/venv3.9/bin"
PYTHON_VERSION: '3.9'
install:
# AppVeyor's apt-get cache might be outdated, and the package could potentially be 404.
- sh: "sudo apt-get update"
- sh: "gvm use go1.19"
- sh: "echo $PATH"
- sh: "ls /usr/"
- sh: "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64"
- sh: "PATH=$JAVA_HOME/bin:$PATH"
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- sh: "rvm use 2.7.2"
- sh: "docker --version"
# install nodejs
- sh: "nvm install --lts=Fermium"
- sh: "node --version"
- sh: "npx --version"
# Install AWS CLI
- sh: "virtualenv aws_cli"
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"
# Install latest maven
- sh: "sudo apt update"
- sh: "sudo apt install maven"
- sh: "mvn --version"
- sh: "PATH=$PATH:$HOME/venv3.7/bin:$HOME/venv3.8/bin:$HOME/venv3.9/bin:$HOME/venv3.10/bin"
# get testing env vars
- sh: "sudo apt install -y jq"
- sh: "python3.9 -m venv .venv_env_vars"
- sh: ".venv_env_vars/bin/pip install boto3"
- sh: "test_env_var=$(.venv_env_vars/bin/python tests/get_testing_resources.py)"
- sh: '
if [ $? -ne 0 ]; then
echo "get_testing_resources failed. Failed to acquire credentials or test resources.";
false;
fi
'
- sh: 'export CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID'
- sh: 'export CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY'
- sh: 'export CI_ACCESS_ROLE_AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN'
- sh: 'export AWS_ACCESS_KEY_ID=$(echo "$test_env_var" | jq -j ".accessKeyID")'
- sh: 'export AWS_SECRET_ACCESS_KEY=$(echo "$test_env_var" | jq -j ".secretAccessKey")'
- sh: 'export AWS_SESSION_TOKEN=$(echo "$test_env_var" | jq -j ".sessionToken")'
- sh: 'export TASK_TOKEN=$(echo "$test_env_var" | jq -j ".taskToken")'
- sh: 'export AWS_S3_TESTING=$(echo "$test_env_var" | jq -j ".TestBucketName")'
- sh: 'export AWS_ECR_TESTING=$(echo "$test_env_var" | jq -j ".TestECRURI")'
- sh: 'export AWS_KMS_KEY=$(echo "$test_env_var" | jq -j ".TestKMSKeyArn")'
- sh: 'export AWS_SIGNING_PROFILE_NAME=$(echo "$test_env_var" | jq -j ".TestSigningProfileName")'
- sh: 'export AWS_SIGNING_PROFILE_VERSION_ARN=$(echo "$test_env_var" | jq -j ".TestSigningProfileARN")'
# required for RIE with arm64 in linux
- sh: "docker run --rm --privileged multiarch/qemu-user-static --reset -p yes"
# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"
build_script:
- "python -c \"import sys; print(sys.executable)\""
test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""
# Runs only in Linux, logging Public ECR when running canary and cred is available
- sh: "
if [[ -n $BY_CANARY ]];
then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws;
fi"
- "pip install -e \".[dev]\""
- sh: "pytest -vv tests/iac_integration"
# Final clean up no matter success or failure
on_finish:
- sh: 'export AWS_ACCESS_KEY_ID=$CI_ACCESS_ROLE_AWS_ACCESS_KEY_ID'
- sh: 'export AWS_SECRET_ACCESS_KEY=$CI_ACCESS_ROLE_AWS_SECRET_ACCESS_KEY'
- sh: 'export AWS_SESSION_TOKEN=$CI_ACCESS_ROLE_AWS_SESSION_TOKEN'
- sh: 'aws stepfunctions send-task-success --task-token "$TASK_TOKEN" --task-output "{}" --region us-west-2'