mirror of
https://github.com/GeorgeSG/sarah.git
synced 2025-12-28 20:30:29 +00:00
Upload bin files
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +0,0 @@
|
||||
bin/
|
||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
@@ -2,4 +2,4 @@
|
||||
"files.associations": {
|
||||
"*.yaml": "home-assistant"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
.vscode/tasks.json
vendored
22
.vscode/tasks.json
vendored
@@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
13
README.md
13
README.md
@@ -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)
|
||||
|
||||
3
bin/.env.example
Normal file
3
bin/.env.example
Normal file
@@ -0,0 +1,3 @@
|
||||
REMOTE_REPO_PATH="/path/to/repo"
|
||||
REMOTE_HOST="username@server"
|
||||
REMOTE_PORT="22"
|
||||
1
bin/.gitignore
vendored
Normal file
1
bin/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
.env
|
||||
6
bin/logs
Executable file
6
bin/logs
Executable file
@@ -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"
|
||||
7
bin/restart
Executable file
7
bin/restart
Executable file
@@ -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"
|
||||
11
bin/ui
Executable file
11
bin/ui
Executable file
@@ -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"
|
||||
6
bin/update
Executable file
6
bin/update
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
sh "$(dirname $0)/upload"
|
||||
|
||||
echo
|
||||
sh "$(dirname $0)/restart"
|
||||
15
bin/upload
Executable file
15
bin/upload
Executable file
@@ -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