Fixes to custom deps (#422)

* Fix spelling

* Cleanup up custom_deps/run.sh

* Disable sheelcheck warning

* Update run.sh

* Update CHANGELOG.md

* Update config.json

* Create build.json

* Update Dockerfile
This commit is contained in:
George Marshall
2018-10-10 01:07:35 -07:00
committed by Pascal Vizeli
parent c7cbeb6972
commit 446dd8d65c
4 changed files with 16 additions and 12 deletions

View File

@@ -1,10 +1,13 @@
# Changelog
## 1
- Bug fix multiple pip packages v2
## 0.3
- Bugfix multible pip packages
- Bug fix multiple pip packages
## 0.2
- Bugfix pip prefix settings
- Bug fix pip prefix settings
## 0.1
- Initial release

View File

@@ -6,7 +6,7 @@ ENV LANG C.UTF-8
# Setup base
RUN apk add --no-cache \
jq python3 gcc g++ make cmake git python3-dev
gcc g++ make cmake git
# Copy data
COPY run.sh /

View File

@@ -1,6 +1,6 @@
{
"name": "Custom deps deployment",
"version": "0.3",
"version": "1",
"slug": "custom_deps",
"description": "Manage custom python modules in Home Assistant deps",
"url": "https://home-assistant.io/addons/custom_deps/",

View File

@@ -3,19 +3,20 @@ set -e
CONFIG_PATH=/data/options.json
PYPI="$(jq --raw-output '.pypi | join(" ")' $CONFIG_PATH)"
APK="$(jq --raw-output '.apk | join(" ") // empty' $CONFIG_PATH)"
PYPI="$(jq --raw-output '.pypi | join(" ")' ${CONFIG_PATH})"
APK="$(jq --raw-output '.apk | join(" ") // empty' ${CONFIG_PATH})"
# Cleanup old deps
echo "[Info] Remove old deps"
rm -rf /config/deps/*
# Need custom apk for build?
if [ -n "$APK" ]; then
if [ -n "${APK}" ]; then
echo "[Info] Install apks for build"
if ! ERROR="$(apk add --no-cache "${APK[@]}")"; then
# shellcheck disable=SC2086
if ! ERROR="$(apk add --no-cache ${APK})"; then
echo "[Error] Can't install packages!"
echo "$ERROR" && exit 1
echo "${ERROR}" && exit 1
fi
fi
@@ -24,9 +25,9 @@ echo "[Info] Install pypi modules into deps"
export PYTHONUSERBASE=/config/deps
# shellcheck disable=SC2086
if ! ERROR="$(pip3 install --user --no-cache-dir --prefix= --no-dependencies $PYPI)"; then
echo "[Error] Can't install pypi packages!"
echo "$ERROR" && exit 1
if ! ERROR="$(pip3 install --user --no-cache-dir --prefix= --no-dependencies ${PYPI})"; then
echo "[Error] Can't install PyPI packages!"
echo "${ERROR}" && exit 1
fi
echo "[Info] done"