Skip to content

Commit

Permalink
Migrate GitPull new CLI (home-assistant#1109)
Browse files Browse the repository at this point in the history
* Migrate GitPull new CLI

* fix naming
  • Loading branch information
pvizeli authored Feb 19, 2020
1 parent a16006c commit 397c476
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
4 changes: 4 additions & 0 deletions git_pull/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 7.9

- Update Home Assistant CLI to 4.0.1

## 7.8

- Added support for Azure DevOps repositories by removing the requirement for the `.git` suffix
Expand Down
6 changes: 3 additions & 3 deletions git_pull/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ RUN apk add --no-cache jq curl git openssh-client
# Home Assistant CLI
ARG BUILD_ARCH
ARG CLI_VERSION
RUN curl -Lso /usr/bin/hassio \
"https://github.com/home-assistant/hassio-cli/releases/download/${CLI_VERSION}/hassio_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/hassio
RUN curl -Lso /usr/bin/ha \
"https://github.com/home-assistant/cli/releases/download/${CLI_VERSION}/ha_${BUILD_ARCH}" \
&& chmod a+x /usr/bin/ha

# Copy data
COPY data/run.sh /
Expand Down
2 changes: 1 addition & 1 deletion git_pull/build.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"i386": "homeassistant/i386-base:3.11"
},
"args": {
"CLI_VERSION": "3.1.1"
"CLI_VERSION": "4.0.1"
}
}
2 changes: 1 addition & 1 deletion git_pull/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Git pull",
"version": "7.8",
"version": "7.9",
"slug": "git_pull",
"description": "Simple git pull to update the local configuration",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/git_pull",
Expand Down
4 changes: 2 additions & 2 deletions git_pull/data/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ function validate-config {
NEW_COMMIT=$(git rev-parse HEAD)
if [ "$NEW_COMMIT" != "$OLD_COMMIT" ]; then
echo "[Info] Something has changed, checking Home-Assistant config..."
if hassio --no-progress homeassistant check; then
if ha --no-progress core check; then
if [ "$AUTO_RESTART" == "true" ]; then
DO_RESTART="false"
CHANGED_FILES=$(git diff "$OLD_COMMIT" "$NEW_COMMIT" --name-only)
Expand Down Expand Up @@ -204,7 +204,7 @@ function validate-config {
fi
if [ "$DO_RESTART" == "true" ]; then
echo "[Info] Restart Home-Assistant"
hassio --no-progress homeassistant restart 2&> /dev/null
ha --no-progress core restart 2&> /dev/null
else
echo "[Info] No Restart Required, only ignored changes detected"
fi
Expand Down

0 comments on commit 397c476

Please sign in to comment.