Skip to content

Commit 65ef14f

Browse files
author
Travis CI
committed
particle deploy in progress
1 parent d14f7b2 commit 65ef14f

8 files changed

+88
-6
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*.lo
44
*.o
55
*.obj
6+
*.hne
7+
deploy/
68

79
# Precompiled Headers
810
*.gch

particle/build.sh

+14-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ mkdir -p $SRC_DIR
1515

1616
echo "copying main headers"
1717
cp $PLATFORM/spark.json $BUILD_DIR/
18-
cp $PLATFORM/tentacle-build.h $SRC_DIR/
19-
cp $PLATFORM/tentacle-build.cpp $SRC_DIR/
18+
cp $PLATFORM/tentacle-particle.h $SRC_DIR/
19+
cp $PLATFORM/tentacle-particle.cpp $SRC_DIR/
2020

2121
echo "copying examples"
22-
cp -r $PLATFORM/examples $BUILD_DIR/examples
22+
cp -r $PLATFORM/examples $SRC_DIR/examples
2323

2424
echo "copying projects"
2525
cp -r $DOWNLOAD_DIR/* $SRC_DIR
@@ -29,3 +29,14 @@ cd $SRC_DIR/tentacle-pseudopod
2929
cp $SRC_DIR/tentacle-protocol-buffer/tentacle-message.proto .
3030
rm -f *.pb*
3131
$TOOLS_DIR/nanopb/generator-bin/protoc --nanopb_out=. tentacle-message.proto
32+
33+
cd $BASE_DIR
34+
echo "'Fixing' library paths"
35+
sed -ine 's/"tentacle.h"/"tentacle-particle\/tentacle\/tentacle.h"/' $SRC_DIR/tentacle-arduino/tentacle-arduino.h
36+
sed -ine 's/"proto-buf.h"/"tentacle-particle\/tentacle-pseudopod\/proto-buf.h"/' $SRC_DIR/tentacle/tentacle.h
37+
sed -ine 's/<pb.h>/"arduino-nanopb\/pb.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-message.pb.h
38+
sed -ine 's/"pb_encode.h"/"tentacle-particle\/arduino-nanopb\/pb_encode.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-pseudopod.h
39+
sed -ine 's/"pb_decode.h"/"tentacle-particle\/arduino-nanopb\/pb_decode.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-pseudopod.h
40+
sed -ine 's/"pb_arduino_encode.h"/"tentacle-particle\/arduino-nanopb\/pb_arduino_encode.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-pseudopod.h
41+
sed -ine 's/"pb_arduino_decode.h"/"tentacle-particle\/arduino-nanopb\/pb_arduino_decode.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-pseudopod.h
42+
sed -ine 's/"tentacle.h"/"tentacle-particle\/tentacle\/tentacle.h"/' $SRC_DIR/tentacle-pseudopod/tentacle-pseudopod.h

particle/deploy.sh

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
set -e
3+
PLATFORM=particle
4+
BASE_DIR=`pwd`
5+
DEPLOY_DIR=$BASE_DIR/deploy/$PLATFORM
6+
BUILD_DIR=$BASE_DIR/build/$PLATFORM
7+
8+
echo "deploying for $PLATFORM"
9+
echo "clean"
10+
rm -rf $DEPLOY_DIR
11+
mkdir -p $DEPLOY_DIR
12+
13+
echo "cloning repo for $PLATFORM"
14+
echo git@github.com:octoblu/tentacle-dist-$PLATFORM
15+
git clone git@github.com:octoblu/tentacle-dist-$PLATFORM $DEPLOY_DIR
16+
git config user.name "Travis CI"
17+
git config user.email "sqrt+travis@octoblu.com"
18+
19+
echo "removing old code"
20+
cd $DEPLOY_DIR
21+
rm -rf *.cpp *.h examples/ firmware/ *tentacle* *arduino*
22+
cp -r $BUILD_DIR/* .
23+
echo "copied new code"
24+
git add .
25+
git commit -a -m "travis, constructing the TERRIFYING TENTACLE for $PLATFORM"
26+
git push
27+
28+
29+
# git add .
30+
# git commit -m "Deploy to GitHub Pages"
31+
#
32+
# # Force push from the current repo's master branch to the remote
33+
# # repo's gh-pages branch. (All previous history on the gh-pages branch
34+
# # will be lost, since we are overwriting it.) We redirect any output to
35+
# # /dev/null to hide any sensitive credential data that might otherwise be exposed.
36+
# git push --force --quiet "https://${GH_TOKEN}@${GH_REF}" master:gh-pages > /dev/null 2>&1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#include "tentacle-particle.h"
2+
3+
#define conn Serial
4+
5+
TentacleArduino tentacle;
6+
Pseudopod pseudopod(conn, conn, tentacle);
7+
8+
void setup() {
9+
Serial.begin(57600);
10+
}
11+
12+
void loop() {
13+
readData();
14+
15+
if(!pseudopod.isConfigured()) {
16+
delay(100);
17+
pseudopod.requestConfiguration();
18+
}
19+
20+
if(pseudopod.shouldBroadcastPins() ) {
21+
delay(pseudopod.getBroadcastInterval());
22+
pseudopod.sendConfiguredPins();
23+
}
24+
}
25+
26+
void readData() {
27+
while (conn.available()) {
28+
if(pseudopod.readMessage() == TentacleMessageTopic_action) {
29+
pseudopod.sendPins();
30+
}
31+
}
32+
33+
}

particle/tentacle-build.cpp

-1
This file was deleted.

particle/tentacle-build.h

-2
This file was deleted.

particle/tentacle-particle.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "tentacle-particle.h"

particle/tentacle-particle.h

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#include "tentacle-particle/tentacle-arduino/tentacle-arduino.h"
2+
#include "tentacle-particle/tentacle-pseudopod/tentacle-pseudopod.h"

0 commit comments

Comments
 (0)