2020-07-10 07:01:28 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# exit on error
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# detect os/ver for install type
|
|
|
|
os=""
|
|
|
|
if [[ -f /etc/os-release ]]; then
|
|
|
|
. /etc/os-release
|
|
|
|
os=${ID}
|
|
|
|
fi
|
|
|
|
|
2020-07-10 16:51:40 +01:00
|
|
|
# parse arguments
|
|
|
|
dev=""
|
|
|
|
verbose=""
|
2020-07-10 18:23:45 +01:00
|
|
|
while getopts "dv" opt; do
|
2020-07-10 16:51:40 +01:00
|
|
|
case ${opt} in
|
|
|
|
d)
|
|
|
|
dev="-d"
|
|
|
|
;;
|
|
|
|
v)
|
|
|
|
verbose="-v"
|
|
|
|
;;
|
|
|
|
\?)
|
|
|
|
echo "script usage: $(basename $0) [-d] [-v]" >&2
|
|
|
|
echo "" >&2
|
|
|
|
echo "-v enable verbose install" >&2
|
|
|
|
echo "-d enable developer install" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
|
2020-07-10 07:01:28 +01:00
|
|
|
echo "installing CORE for ${os}"
|
|
|
|
case ${os} in
|
|
|
|
"ubuntu")
|
2020-07-10 07:27:05 +01:00
|
|
|
sudo apt install -y python3-pip python3-venv
|
2020-07-10 07:01:28 +01:00
|
|
|
;;
|
|
|
|
"centos")
|
|
|
|
sudo yum install -y python3-pip
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "unknown OS ID ${os} cannot install"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
python3 -m pip install --user pipx
|
|
|
|
python3 -m pipx ensurepath
|
2020-07-10 07:27:05 +01:00
|
|
|
export PATH=$PATH:~/.local/bin
|
|
|
|
pipx install invoke
|
2020-07-10 16:56:16 +01:00
|
|
|
inv install ${dev} ${verbose}
|