Skip to content

Commit

Permalink
reorganize prebuild scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
hobbyquaker committed Jul 9, 2020
1 parent 97d3829 commit 14ded26
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 30 deletions.
14 changes: 14 additions & 0 deletions prebuild_armv6l.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

DEST="prebuilt/armv6l"
REMOTE="root@pi-black"
REMOTE_PATH="/root/redmatic-prebuild"

cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")' > $DEST/package.json

scp $DEST/package.json $REMOTE:$REMOTE_PATH

ssh -t $REMOTE "cd $REMOTE_PATH ; npm install --global-style --unsafe-perm --no-package-lock"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-node-sqlite ; npm install --unsafe-perm --build-from-source --no-package-lock sqlite3"

./prebuild_armv6l_copy.sh
35 changes: 35 additions & 0 deletions prebuild_armv6l_copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

DEST="prebuilt/armv6l"
REMOTE="root@pi-black"
REMOTE_PATH="/root/redmatic-prebuild"

rm -r ${DEST}/lib/node_modules

files=`ssh -t $REMOTE "cd $REMOTE_PATH ; find ./ -type f -name \*.node |grep -v obj.target"`

while read -r binary; do
from=`echo ${REMOTE}:${REMOTE_PATH}/${binary} | tr -d '\r'`
dest=`echo ${DEST}/lib/${binary%/*} | tr -d '\r'`
mkdir -p ${dest}
scp -q ${from} ${dest} && echo "${binary}"
done <<< "$files"

#scp $REMOTE:/usr/bin/pig2vcd $DEST/bin/
#scp $REMOTE:/usr/bin/pigpiod $DEST/bin/
#scp $REMOTE:/usr/bin/pigs $DEST/bin/
#scp $REMOTE:/usr/lib/libpigpiod_if2.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpiod_if.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpio.so $DEST/lib/

ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production raspi-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production pinoccio-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production bean-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production blend-micro-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production imp-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production particle-io"

scp -r $REMOTE:$REMOTE_PATH/node_modules/node-red-contrib-johnny-five/node_modules $DEST/lib/node_modules/node-red-contrib-johnny-five


git add $DEST/lib
32 changes: 2 additions & 30 deletions prebuild_i686.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,11 @@ DEST="prebuilt/i686"
REMOTE="root@debian-32"
REMOTE_PATH="/root/redmatic-prebuild"

cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red")' > $DEST/package.json
cat addon_files/redmatic/lib/package.json | jq 'del(.dependencies.npm,.dependencies."node-red",.dependencies."@node-red-contrib-themes/midnight-red",.dependencies.node-red-contrib-johnny-five,.dependencies.node-red-contrib-rcswitch2)' > $DEST/package.json

scp $DEST/package.json $REMOTE:$REMOTE_PATH

ssh -t $REMOTE "cd $REMOTE_PATH ; npm install --global-style --unsafe-perm --no-package-lock"
ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-node-sqlite ; npm install --unsafe-perm --build-from-source --no-package-lock sqlite3"

rm -r ${DEST}/lib/node_modules

files=`ssh -t $REMOTE "cd $REMOTE_PATH ; find ./ -type f -name \*.node |grep -v obj.target"`

while read -r binary; do
from=`echo ${REMOTE}:${REMOTE_PATH}/${binary} | tr -d '\r'`
dest=`echo ${DEST}/lib/${binary%/*} | tr -d '\r'`
mkdir -p ${dest}
scp -q ${from} ${dest} && echo "${binary}"
done <<< "$files"

#scp $REMOTE:/usr/bin/pig2vcd $DEST/bin/
#scp $REMOTE:/usr/bin/pigpiod $DEST/bin/
#scp $REMOTE:/usr/bin/pigs $DEST/bin/
#scp $REMOTE:/usr/lib/libpigpiod_if2.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpiod_if.so $DEST/lib/
#scp $REMOTE:/usr/lib/libpigpio.so $DEST/lib/

#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production raspi-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production pinoccio-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production bean-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production blend-micro-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production imp-io"
#ssh -t $REMOTE "cd $REMOTE_PATH/node_modules/node-red-contrib-johnny-five ; npm install --save --unsafe-perm --global-style --production particle-io"

#scp -r $REMOTE:$REMOTE_PATH/node_modules/node-red-contrib-johnny-five/node_modules $DEST/lib/node_modules/node-red-contrib-johnny-five


git add $DEST/lib
./prebuild_i686_copy.sh
19 changes: 19 additions & 0 deletions prebuild_i686_copy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

DEST="prebuilt/i686"
REMOTE="root@debian-32"
REMOTE_PATH="/root/redmatic-prebuild"

rm -r ${DEST}/lib/node_modules

files=`ssh -t $REMOTE "cd $REMOTE_PATH ; find ./ -type f -name \*.node |grep -v obj.target"`

while read -r binary; do
echo $binary
from=`echo ${REMOTE}:${REMOTE_PATH}/${binary} | tr -d '\r'`
dest=`echo ${DEST}/lib/${binary%/*} | tr -d '\r'`
mkdir -p ${dest}
scp -q ${from} ${dest} && echo "${binary}"
done <<< "$files"

git add $DEST/lib

0 comments on commit 14ded26

Please sign in to comment.