Skip to content

Commit 48f01c6

Browse files
authored
Merge pull request #38 from RebeccaStankus/automatedApps
Make automated apps script run on any stack.
2 parents ae5ebcc + 61c672f commit 48f01c6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

testing/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
## Instructions
77
1. Open a console that can run a shell script. (Powershell, Bash, etc.)
88
2. Navigate to this folder in the console
9-
3. Run the testing app called `testingApps.sh`.
9+
3. Run the testing app called `testingApps.sh` from the main folder of the 'Spatial-Audio-API-Examples' repo.
1010
In Powershell, i.e. `bash testing/testApps.sh`
1111
4. Follow the instructions in the console from there!

testing/testApps.sh

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ are connected in space inspector and ready to give me account credentials.${DIM}
2626
read
2727
echo -e "${GREEN}What token did you use to connect to space inspector?${PURPLE}"
2828
read token
29+
echo -e "${GREEN}What stack is that token for? (ex. 'api.highfidelity.com')${PURPLE}"
30+
read stackname
2931
echo -e "${GREEN}What is your app ID?${PURPLE}"
3032
read appID
3133
echo -e "${GREEN}What is the secret key for that app?${PURPLE}"
@@ -46,7 +48,7 @@ RUN unzip hifiZip.zip\n
4648
CMD python3 -m http.server 8060" > Dockerfile
4749
docker build --no-cache -f Dockerfile . -t simple | sed 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g'
4850
docker run -d -p 8060:8060 --name simple simple
49-
echo -e "\n${GREEN}The simple web app is running. Navigate to ${CYAN}http://localhost:8060/ ${GREEN}to verify
51+
echo -e "\n${GREEN}The simple web app is running. Navigate to ${CYAN}http://localhost:8060/?stack=${stackname} ${GREEN}to verify
5052
that you can connect through it. You should see the test app avatar appear in space inspector and should
5153
be able to hear yourself. Leave your feedback and press 'ENTER' when you are done.${PURPLE}"
5254
read simpleStatus
@@ -63,6 +65,7 @@ touch Dockerfile
6365
sed -i "s/APP_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_ID = \"${appID}\"/g" index.js
6466
sed -i "s/SPACE_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/SPACE_ID = \"${spaceID}\"/g" index.js
6567
sed -i "s/APP_SECRET = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_SECRET = \"${appSecret}\"/g" index.js
68+
sed -i "s/connectToHiFiAudioAPIServer(hiFiSampleJWT)/connectToHiFiAudioAPIServer(hiFiSampleJWT, '${stackname}')/g" index.js
6669
echo -e "FROM node:14\n
6770
COPY [\"package.json\", \"index.js\", \"./\"]\n
6871
RUN npm install\n
@@ -81,12 +84,12 @@ docker rmi get-jwt
8184
echo -e "${GREEN}\nNow I am going to create a test for a DJ Bot by creating a docker container that runs a DJ
8285
Bot in the space you provided. Let me set that up...${DIM}"
8386
cd ../djbot
84-
# change this once file is pushed to repo
8587
cp ../../../../../testing/testAudio.mp3 .
8688
touch Dockerfile
8789
sed -i "s/APP_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_ID = \"${appID}\"/g" index.js
8890
sed -i "s/SPACE_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/SPACE_ID = \"${spaceID}\"/g" index.js
8991
sed -i "s/APP_SECRET = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_SECRET = \"${appSecret}\"/g" index.js
92+
sed -i "s/connectToHiFiAudioAPIServer(hiFiJWT)/connectToHiFiAudioAPIServer(hiFiJWT, '${stackname}')/g" index.js
9093
echo -e "FROM node:14\n
9194
COPY [\"package.json\", \"index.js\", \"testAudio.mp3\", \"./\"]\n
9295
RUN npm install\n
@@ -108,6 +111,7 @@ touch Dockerfile
108111
sed -i "s/APP_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_ID = \"${appID}\"/g" index.js
109112
sed -i "s/SPACE_ID = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/SPACE_ID = \"${spaceID}\"/g" index.js
110113
sed -i "s/APP_SECRET = \"aaaaaaaa-1111-bbbb-2222-cccccccccccc\"/APP_SECRET = \"${appSecret}\"/g" index.js
114+
sed -i "s/connectToHiFiAudioAPIServer(HIFI_AUDIO_JWT)/connectToHiFiAudioAPIServer(HIFI_AUDIO_JWT, '${stackname}')/g" ./views/index.ejs
111115
echo -e "FROM node:14\n
112116
COPY [\"package.json\", \"package-lock.json\", \"index.js\", \"./\"]\n
113117
COPY [\"views\", \"./views/\"]\n

0 commit comments

Comments
 (0)