forked from node-red/node-red-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
combine functions for easier maintenance.
- Loading branch information
1 parent
71184ff
commit 5efe3ce
Showing
9 changed files
with
74 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# Install Python3 and pigpio library for arm | ||
if [[ ${DEVTOOLS} == "1" ]]; then | ||
echo "Installing Devtools" | ||
|
||
apk --no-cache add --virtual builds-deps build-base | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
set -ex | ||
|
||
# Install Python2 | ||
if [[ ${PYTHON_VERSION} == "2" ]]; then | ||
echo "Installing Python 2" | ||
apk add --no-cache python | ||
fi | ||
|
||
# Install Python3 | ||
if [[ ${PYTHON_VERSION} == "3" ]]; then | ||
echo "Installing Python 3" | ||
apk add --no-cache python3 | ||
echo "Fixing Python 3 symlink" | ||
ln -s /usr/bin/python3 /usr/bin/python | ||
fi | ||
|
||
# Install rpigpio library for arm | ||
if [[ ${PYTHON_VERSION} != "0" ]]; then | ||
if [[ ${ARCH} == "arm32v6" ]] || [[ ${ARCH} == "arm32v7" ]]; then | ||
echo "Installing py-rpigpio" | ||
apk add py-rpigpio | ||
|
||
echo "Fixing 36-rpi-gpio.js for Python" | ||
sed -i 's/python2.7/python/g' node_modules/\@node-red/nodes/core/hardware/36-rpi-gpio.js | ||
# Create symlink for python libs | ||
ln -s /usr/lib/python$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))') /usr/lib/python | ||
fi | ||
fi | ||
|
||
# Remove Node-Red build-in rpi-gpio when python is not installed or for non arm arch | ||
if [[ ${PYTHON_VERSION} == "0" ]] || ! { [[ ${ARCH} == "arm32v6" ]] || [[ ${ARCH} == "arm32v7" ]]; }; then | ||
echo "Removing Node-RED build-in rpi-gpio" | ||
rm -r node_modules/\@node-red/nodes/core/hardware/* | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters