dev: make cni, consul, dev, docker, and vault scripts Lima compat. (#16689)

This commit is contained in:
James Rasell
2023-03-28 16:21:14 +01:00
committed by GitHub
parent fd900d0723
commit ee9e2e0fa1
7 changed files with 69 additions and 33 deletions

27
scripts/linux-priv-dev.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Install Development utilities
apt-get install -y \
default-jre \
htop \
qemu \
silversearcher-ag \
vim
# Install Chrome for running tests (in headless mode)
curl -sSL -o- https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
apt-get update
apt-get install -y google-chrome-stable
# Set hostname -> IP to make advertisement work as expected
ip=$(ip route get 1 | awk '{print $NF; exit}')
hostname=$(hostname)
sed -i -e "s/.*nomad.*/${ip} ${hostname}/" /etc/hosts
# Ensure we cd into the working directory on login
if [ -d /home/vagrant/ ] ; then
if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then
echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile
fi
fi