Skip to content

Instantly share code, notes, and snippets.

@BusterNeece
Last active August 31, 2024 22:14
Show Gist options
  • Save BusterNeece/273740ee2a4736ba88c5e4e9a9a0070c to your computer and use it in GitHub Desktop.
Save BusterNeece/273740ee2a4736ba88c5e4e9a9a0070c to your computer and use it in GitHub Desktop.
Pixel.horse Ubuntu Quick Install Script
#!/usr/bin/env bash
#
# Pixel.horse Easy Installer
#
# Drop this script into a folder you want to spin up Pixel.horse in, then run it!
# - Pull the script to a local file (i.e. click the "Raw" button on the top right)
# - Run `chmod a+x ./this_script_name.sh`
# - Run `./this_script_name.sh` as your regular user (not root)
#
#
# .,
# / :
# / :'--..
# .^.,-`/ : `.
# .-``| 'j./ :''-. )
# ..`-'`(..-./ :' \ |
# ( ,\'`` '- . | `._ _.---.
# |( '`-..__ `. ( ```_._ \
# (( `.(.---. ``\ ) `-..-'` \ )
# |(```:``'-.\ / .' . : (
# .-..-. |(`. ( ((WW)''--' * x ( `..,__
# ( \ \ _.._.--. ( \| '. \`,| `. `-_ `-
# ' '._`-._..-'``__ `-. '. \ | `'--' ..7 . ``-.. \
# '. ``` /``` `'. \ \ \| `-.-~-.`-/ * ___ ) | .
# .-.:>. \__. '. \ \ | (`'.`' `-.. .-'``.--`'-._.' `--'|
# ( ( . . \ \) \ `'._ `--..-'`.-'` `'-.____..-'
# `'-._ `'(__. : \ /''-. \ ```''''```
# .7 (_. ( \:``\ `'---'\
# .' , \ '- \ ._)`. )
# \__--': . . `' \ -..'/
# / ,: ,/\ /\__. . .`'--`
# '--'` `--' `' / | : /|.-'```''.
# / | |` |.-'``-. `-.
# / | : ( . x`- )
# .'_ () .'| '. ' ) ( ..--.
# ( ..`L_ / \| : '. `-.`' .-.`.__
# (( C` )\ ( \ \ . * `--' ,.) ``.
# \`'` )o )./-\ \.-.(\ .-. .'. .-'``/
# (`--',./.-''-:. -( \) `.-.`'---' .'
# `-._ _(`.: \-...) ``'''``
# `''''=:_` |---'
# ````
# Install core functions
sudo apt-get update
sudo apt-get install -q -y zip unzip git make curl
# Install Docker and Docker Compose
wget -qO- https://get.docker.com/ | sh
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
sudo usermod -aG docker `whoami`
# Install golang
curl -L https://dl.google.com/go/go1.10.linux-amd64.tar.gz > golang.tar.gz
sudo tar -C /usr/local -xzf golang.tar.gz
echo "export GOPATH=\$HOME/go" >> ~/.profile
echo "export PATH=\$PATH:/usr/local/go/bin:\$GOPATH/bin" >> ~/.profile
source ~/.profile
rm -rf ./golang.tar.gz
# Install retool
go get github.com/twitchtv/retool
# Install protobuf
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
sudo mv protoc3/bin/* /usr/local/bin/
sudo mv protoc3/include/* /usr/local/include/
sudo chown `whoami` /usr/local/bin/protoc
sudo chown -R `whoami` /usr/local/include/google
rm -rf ./protoc-*.zip ./protoc3*
# Clone the repos
git clone https://github.com/pixeldothorse/pixeldothorse.git ./pixeldothorse
git clone https://github.com/pixeldothorse/frontend.git ./frontend
# Symlink backend into GOPATH
mkdir -p $GOPATH/src/github.com/pixeldothorse
ln -s $PWD/pixeldothorse/ $GOPATH/src/github.com/pixeldothorse/pixeldothorse
# Instructions for post-install setup
echo " "
echo "Pixel.horse initial setup complete!"
echo " "
echo "To update your profile variables, please run:"
echo " source ~/.profile"
echo " "
echo "Reboot or log out to apply Docker group permissions to your current user."
echo " "
echo "Once this is done, you can spin up the Docker instance by running:"
echo " cd $PWD/pixeldothorse/"
echo " make docker"
echo " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment