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

40 lines
1.3 KiB
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 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}
# Update package cache
sudo apt-get update
# 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
# Install Home Assistant
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 goreleaser
go install github.com/goreleaser/goreleaser@latest
# Install go build packages
go install golang.org/x/tools/cmd/stringer@latest
go install github.com/fyne-io/fyne-cross@latest
go install golang.org/x/text/cmd/gotext@latest
go install github.com/matryer/moq@latest