joshuar-go-hass-agent/tools/devcontainer/postcreate

27 lines
977 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2023 Joshua Rich <joshua.rich@gmail.com>
#
# 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