Skip to content

Commit e34d379

Browse files
authored
Pubsub in ci (#181)
* Run pubsub in codebuild CI job
1 parent 973f7c3 commit e34d379

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 0.2
2+
phases:
3+
install:
4+
commands:
5+
- add-apt-repository ppa:ubuntu-toolchain-r/test
6+
- apt-get update -y
7+
build:
8+
commands:
9+
- echo Build started on `date`
10+
- $CODEBUILD_SRC_DIR/codebuild/samples/setup-linux.sh
11+
- $CODEBUILD_SRC_DIR/codebuild/samples/pubsub-linux.sh
12+
post_build:
13+
commands:
14+
- echo Build completed on `date`

codebuild/samples/pubsub-linux.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
env
6+
7+
pushd $CODEBUILD_SRC_DIR/samples/node/pub_sub
8+
9+
ENDPOINT=$(aws secretsmanager get-secret-value --secret-id "unit-test/endpoint" --query "SecretString" | cut -f2 -d":" | sed -e 's/[\\\"\}]//g')
10+
11+
npm install --unsafe-perm
12+
13+
echo "Mqtt Direct test"
14+
node dist/index.js --endpoint $ENDPOINT --key /tmp/privatekey.pem --cert /tmp/certificate.pem
15+
16+
echo "Websocket test"
17+
node dist/index.js --endpoint $ENDPOINT --use_websocket --signing_region us-east-1
18+
19+
popd

codebuild/samples/setup-linux.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
env
6+
7+
# build package
8+
cd $CODEBUILD_SRC_DIR
9+
10+
ulimit -c unlimited
11+
npm install --unsafe-perm
12+
13+
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
14+
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

0 commit comments

Comments
 (0)