@@ -4,7 +4,7 @@ version: 0.2
44env :
55 shell : bash
66 variables :
7- CANARY_DURATION : 25200
7+ CANARY_DURATION : 300
88 CANARY_THREADS : 3
99 CANARY_TPS : 50
1010 CANARY_CLIENT_COUNT : 10
@@ -24,13 +24,39 @@ phases:
2424 pre_build :
2525 commands :
2626 - export CC=gcc-7
27+ # Retrieve the private key from Secrets Manager
28+ - DEPLOY_KEY=$(aws secretsmanager get-secret-value --secret-id Aws-crt-canaries-deploy-key --query SecretString --output text)
29+
30+ # Set up SSH configuration
31+ - mkdir -p ~/.ssh
32+ - echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
33+ - chmod 600 ~/.ssh/id_rsa
34+
35+ # Add GitHub to known hosts to avoid host verification prompt
36+ - ssh-keyscan -H github.com >> ~/.ssh/known_hosts
37+
38+ # Configure SSH to use the key for GitHub
39+ - |
40+ cat > ~/.ssh/config << EOF
41+ Host github.com
42+ HostName github.com
43+ User git
44+ IdentityFile ~/.ssh/id_rsa
45+ StrictHostKeyChecking no
46+ EOF
47+ - chmod 600 ~/.ssh/config
2748 build :
2849 commands :
2950 - echo Build started on `date`
51+ # pull and copy canary scripts
52+ - git clone git@github.com:awslabs/aws-crt-canaries.git
53+ - cp aws-crt-canaries/source/mqtt5/*.py ./codebuild
3054 - source ./codebuild/mqtt5_test_setup.sh s3://aws-crt-test-stuff/TestIotProdMQTT5EnvironmentVariables.txt us-east-1
3155 - export ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "$CANARY_SERVER_ARN" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
3256 - export GIT_HASH=$(git rev-parse HEAD)
3357 - $CODEBUILD_SRC_DIR/codebuild/mqtt5-python-canary-test.sh
3458 post_build :
3559 commands :
3660 - echo Build completed on `date`
61+ # Clean up SSH keys for security
62+ - rm -rf ~/.ssh/id_rsa ~/.ssh/config
0 commit comments