temp!
This commit is contained in:
parent
9c3a2d89b8
commit
3c6f40a62d
@ -59,46 +59,37 @@ agree() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apt_install() {
|
apt_install() {
|
||||||
sudo apt install --yes --install-recommends $1 > /dev/null
|
sudo apt-get install --yes --install-recommends $1 > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
pip_install() {
|
pip_install() {
|
||||||
pip install --user $1 > /dev/null
|
pip3 install --user $1 > /dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
export PATH=~/.local/bin:$PATH
|
export PATH=~/.local/bin:$PATH
|
||||||
|
|
||||||
agree "Update apt cache" && sudo apt update > /dev/null
|
|
||||||
agree "Upgrade apt packages" "N" && sudo apt upgrade > /dev/null
|
|
||||||
|
|
||||||
missing git && agree "Install git" && apt_install git
|
missing git && agree "Install git" && apt_install git
|
||||||
|
|
||||||
if missing pip; then
|
if missing python; then
|
||||||
agree "Install python-pip" && apt_install python-pip
|
agree "Intsall python-is-python3" && apt_install python-is-python3
|
||||||
agree "Upgrade pip with pip" && \
|
|
||||||
sudo -H pip_install --upgrade pip > /dev/null
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
missing virtualenv && agree "Install virtualenv" && pip_install virtualenv
|
if missing pip3; then
|
||||||
|
agree "Install python-pip" && apt_install python3-pip
|
||||||
|
fi
|
||||||
|
|
||||||
|
if missing virtualenv; then
|
||||||
|
agree "Install python3-virtualenv" && apt_install python3-virtualenv
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -f ~/.ssh/id_rsa ] && agree "Generate SSH key"; then
|
if [ ! -f ~/.ssh/id_rsa ] && agree "Generate SSH key"; then
|
||||||
read -rp "SSH email: " email
|
read -rp "SSH email: " email
|
||||||
[ ! -d ~/.ssh ] && mkdir -p ~/.ssh
|
[ ! -d ~/.ssh ] && mkdir -p ~/.ssh
|
||||||
ssh-keygen -t rsa -b 4096 -C "$email" -N "" -f ~/.ssh/id_rsa
|
ssh-keygen -t ed25519 -C "$email" -N "" -f ~/.ssh/id_rsa
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! missing virtualenv && agree "Set SSH keys on remote Git servers"; then
|
missing conduit && agree "Install ansible" && \
|
||||||
env=$(mktemp -d)
|
pip_install ansible
|
||||||
virtualenv $env > /dev/null
|
|
||||||
source $env/bin/activate
|
|
||||||
pip install git+https://code.infektor.net/config/bootstrap.git > /dev/null
|
|
||||||
python -c 'import bootstrap; bootstrap.set_ssh_keys()'
|
|
||||||
deactivate
|
|
||||||
rm -r $env
|
|
||||||
fi
|
|
||||||
|
|
||||||
missing conduit && agree "Install conduit" && \
|
|
||||||
pip_install git+ssh://git@github.com/kbenzie/conduit.git
|
|
||||||
|
|
||||||
echo "To use installed pip packages update your PATH:"
|
echo "To use installed pip packages update your PATH:"
|
||||||
echo 'export PATH=~/.local/bin:$PATH'
|
echo 'export PATH=~/.local/bin:$PATH'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user