#!/bin/bash set -e env pushd $CODEBUILD_SRC_DIR/samples/shadow/shadow_sync mkdir _build cd _build cmake -DCMAKE_PREFIX_PATH=/tmp/install .. make -j ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "ci/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g') echo "Shadow-Sync test" ./shadow-sync --endpoint $ENDPOINT --key /tmp/privatekey.pem --cert /tmp/certificate.pem --thing_name CI_CodeBuild_Thing --is_ci true popd