- Update & split scripts - Main package install script - Fish / environment install script - Dockerfile for testing locally
64 lines
1.9 KiB
Bash
Executable File
64 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
# run as root/sudo
|
|
if [ "$EUID" -ne 0 ]
|
|
then echo "Please run as root / sudo"
|
|
exit
|
|
fi
|
|
|
|
DOCKER_COMPOSE_VERSION=v2.23.0
|
|
|
|
# Update sources
|
|
apt-get update
|
|
|
|
#tzdata region settings
|
|
TZ_REGION=Europe
|
|
TZ_ZONE=Berlin
|
|
# make tzdata noninteractive on docker...
|
|
echo "tzdata tzdata/Areas select $TZ_REGION" | debconf-set-selections
|
|
echo "tzdata tzdata/Zones/$TZ_REGION select $TZ_ZONE" | debconf-set-selections
|
|
DEBIAN_FRONTEND="noninteractive" apt install tzdata -y
|
|
|
|
# Upgrade System:
|
|
apt-get upgrade -y
|
|
|
|
# install env packages
|
|
apt-get install git fish build-essential jq vim curl sudo unzip fzf htop -y
|
|
|
|
# pyenv dependencies
|
|
apt-get install python3-dev python3-setuptools python3-pip python3-venv python3-smbus pipx liblzma-dev libffi-dev libssl-dev openssl zlib1g-dev libsqlite3-dev tk-dev libreadline-dev libbz2-dev -y
|
|
|
|
# install docker stable, if this failes try below
|
|
curl -fsSLo- https://get.docker.com | sh
|
|
#curl -fsSLo- https://test.docker.com | sh
|
|
|
|
# install docker-compose
|
|
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
|
chmod +x /usr/local/bin/docker-compose
|
|
|
|
# aws cli
|
|
cd /tmp
|
|
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
|
unzip awscliv2.zip
|
|
./aws/install
|
|
rm awscliv2.zip
|
|
rm -rf ./aws
|
|
|
|
# session manager plugin
|
|
curl "https://s3.amazonaws.com/session-manager-downloads/plugin/latest/ubuntu_64bit/session-manager-plugin.deb" -o "session-manager-plugin.deb"
|
|
dpkg -i session-manager-plugin.deb
|
|
cd -
|
|
|
|
read -p "User that will be used after installation complete: " NEW_USER
|
|
passwd $NEW_USER
|
|
|
|
# give user docker permissions
|
|
usermod -aG docker $NEW_USER
|
|
|
|
echo "######################################"
|
|
echo "# Changing default shell to fish now #"
|
|
echo "# Please call ./2_fish_setup.sh #"
|
|
echo "######################################"
|
|
chsh $NEW_USER -s /usr/bin/fish
|
|
sudo -i -u $NEW_USER fish |