-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(devcontainer): add devcontainer configuraion
- Loading branch information
Showing
3 changed files
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"image": "mcr.microsoft.com/devcontainers/python", | ||
"appPort": ["8123:8123"], | ||
"postCreateCommand": "tools/devcontainer/postcreate", | ||
"postStartCommand": ". /workspaces/go-hass-agent/home-assistant/venv/bin/activate && hass -c $HA_PATH/config", | ||
"remoteEnv": { | ||
"PATH": "${containerEnv:PATH}:/usr/local/go/bin", | ||
"GO_DL": "go1.20.5.linux-amd64.tar.gz", | ||
"HA_PATH": "/workspaces/go-hass-agent/home-assistant", | ||
"DISPLAY": "${localEnv:DISPLAY}" | ||
}, | ||
"mounts": [ | ||
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached" | ||
], | ||
"runArgs": [ | ||
"--userns=keep-id:uid=1000,gid=1000" | ||
], | ||
"containerUser": "vscode", | ||
"updateRemoteUserUID": true | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
# Ignore everything | ||
.vscode/ | ||
internal/agent/VERSION | ||
home-assistant | ||
|
||
# But not these files... | ||
!.gitignore | ||
|
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,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright (c) 2023 Joshua Rich <[email protected]> | ||
# | ||
# This software is released under the MIT License. | ||
# https://opensource.org/licenses/MIT | ||
|
||
# Stop on errors | ||
set -e | ||
|
||
# Install Home Assistant | ||
|
||
sudo apt-get update | ||
sudo apt-get install -y python3-pip python3-dev python3-venv autoconf libssl-dev libxml2-dev libxslt1-dev libjpeg-dev libffi-dev libudev-dev zlib1g-dev pkg-config libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libavresample-dev libavfilter-dev ffmpeg | ||
rm -rf ${HA_PATH} && git clone https://github.com/home-assistant/core.git ${HA_PATH} | ||
cd ${HA_PATH} | ||
script/setup | ||
|
||
# Install Go | ||
|
||
curl -L -o /tmp/${GO_DL} https://go.dev/dl/${GO_DL} | ||
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf /tmp/${GO_DL} | ||
|
||
# Install go-hass-agent dependencies | ||
|
||
sudo apt-get -y install libgl1-mesa-dev libxi-dev libxcursor-dev libxrandr-dev libxinerama-dev libxxf86vm-dev dbus-x11 | ||
cd /workspaces/go-hass-agent && go mod download |