Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions codebuild/samples/linux-smoke-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 0.2
phases:
install:
commands:
- add-apt-repository ppa:ubuntu-toolchain-r/test
- apt-get update -y
build:
commands:
- echo Build started on `date`
- $CODEBUILD_SRC_DIR/codebuild/samples/setup-linux.sh
- $CODEBUILD_SRC_DIR/codebuild/samples/pubsub-linux.sh
post_build:
commands:
- echo Build completed on `date`
19 changes: 19 additions & 0 deletions codebuild/samples/pubsub-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

set -e

env

pushd $CODEBUILD_SRC_DIR/samples/node/pub_sub

ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')

npm install --unsafe-perm

echo "Mqtt Direct test"
node dist/index.js --endpoint $ENDPOINT --key /tmp/privatekey.pem --cert /tmp/certificate.pem

echo "Websocket test"
node dist/index.js --endpoint $ENDPOINT --use_websocket --signing_region us-east-1

popd
14 changes: 14 additions & 0 deletions codebuild/samples/setup-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

set -e

env

# build package
cd $CODEBUILD_SRC_DIR

ulimit -c unlimited
npm install --unsafe-perm

cert=$(aws secretsmanager get-secret-value --secret-id "unit-test/certificate" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$cert" > /tmp/certificate.pem
key=$(aws secretsmanager get-secret-value --secret-id "unit-test/privatekey" --query "SecretString" | cut -f2 -d":" | cut -f2 -d\") && echo -e "$key" > /tmp/privatekey.pem