mirror of
https://github.com/GeorgeSG/sarah.git
synced 2026-06-17 01:52:58 +00:00
Upload bin files
This commit is contained in:
@@ -1 +0,0 @@
|
||||
bin/
|
||||
Vendored
+1
-1
@@ -2,4 +2,4 @@
|
||||
"files.associations": {
|
||||
"*.yaml": "home-assistant"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+15
-7
@@ -9,7 +9,9 @@
|
||||
"command": "./bin/ui",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"focus": true
|
||||
"panel": "shared",
|
||||
"echo": false,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -18,7 +20,9 @@
|
||||
"command": "./bin/restart",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"focus": true
|
||||
"panel": "shared",
|
||||
"echo": false,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -27,7 +31,9 @@
|
||||
"command": "./bin/update",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"focus": true
|
||||
"panel": "shared",
|
||||
"echo": false,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -36,7 +42,9 @@
|
||||
"command": "./bin/upload",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"focus": true
|
||||
"panel": "shared",
|
||||
"echo": false,
|
||||
"clear": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -45,9 +53,9 @@
|
||||
"command": "./bin/logs",
|
||||
"problemMatcher": [],
|
||||
"presentation": {
|
||||
"panel": "dedicated",
|
||||
"clear": true,
|
||||
"focus": true
|
||||
"panel": "shared",
|
||||
"echo": false,
|
||||
"clear": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -76,6 +76,19 @@ The `speech` module uses [partial templates](https://github.com/GeorgeSG/sarah/t
|
||||
|
||||

|
||||
|
||||
## Helpers
|
||||
|
||||
There are some useful scripts in `./bin`.
|
||||
|
||||
In order to use them, copy `./bin/.env.example` to `./bin/.env` and set the correct values.
|
||||
You must be able to ssh to the host with a ssh key.
|
||||
|
||||
- `./bin/ui` - re-uploads only UI configuration files
|
||||
- `./bin/upload` - re-uploads all configuration files
|
||||
- `./bin/restart` - restarts Home Assistant via docker-compose
|
||||
- `./bin/update` - `upload` and then `restart`
|
||||
- `./bin/logs` - tails the logs of Home Assisstant via docker-compose
|
||||
|
||||
## Inspiration
|
||||
|
||||
1. [CCOSTAN/Home-AssistantConfig](https://github.com/CCOSTAN/Home-AssistantConfig)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
REMOTE_REPO_PATH="/path/to/repo"
|
||||
REMOTE_HOST="username@server"
|
||||
REMOTE_PORT="22"
|
||||
@@ -0,0 +1 @@
|
||||
.env
|
||||
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o allexport; source "$(dirname $0)/.env"; set +o allexport
|
||||
|
||||
ssh $REMOTE_HOST -p $REMOTE_PORT -t \
|
||||
"docker-compose -f $REMOTE_REPO_PATH/docker/docker-compose.yml logs -f --tail=\"200\" | grep home-assistant"
|
||||
Executable
+7
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o allexport; source "$(dirname $0)/.env"; set +o allexport
|
||||
|
||||
echo "Restarting..."
|
||||
ssh $REMOTE_HOST -p $REMOTE_PORT \
|
||||
"docker-compose -f $REMOTE_REPO_PATH/docker/docker-compose.yml restart"
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o allexport; source "$(dirname $0)/.env"; set +o allexport
|
||||
|
||||
echo "Uploading UI configuration..."
|
||||
|
||||
ssh $REMOTE_HOST -p $REMOTE_PORT "rm -rf $REMOTE_REPO_PATH/config/lovelace"
|
||||
|
||||
scp -P $REMOTE_PORT \
|
||||
-r config/themes/ config/*-lovelace.yaml config/lovelace \
|
||||
"${REMOTE_HOST}:${REMOTE_REPO_PATH}/config"
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
sh "$(dirname $0)/upload"
|
||||
|
||||
echo
|
||||
sh "$(dirname $0)/restart"
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o allexport; source "$(dirname $0)/.env"; set +o allexport
|
||||
|
||||
echo "Deleting old folders..."
|
||||
|
||||
ssh $REMOTE_HOST -p $REMOTE_PORT \
|
||||
"rm -rf $REMOTE_REPO_PATH/config/{custom_scripts,lovelace,packages,templates}"
|
||||
|
||||
echo "Delete completed!"
|
||||
echo
|
||||
|
||||
scp -P $REMOTE_PORT \
|
||||
-r config/{custom_scripts,lovelace,packages,templates,themes,*.yaml} \
|
||||
"${REMOTE_HOST}:${REMOTE_REPO_PATH}/config"
|
||||
Reference in New Issue
Block a user