forked from metal3-io/metal3-dev-env
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubuntu_install_requirements.sh
executable file
·92 lines (76 loc) · 2.53 KB
/
ubuntu_install_requirements.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
set -ex
# shellcheck disable=SC1091
source lib/logging.sh
# shellcheck disable=SC1091
source lib/common.sh
# sudo apt install -y libselinux-utils
# if selinuxenabled ; then
# sudo setenforce permissive
# sudo sed -i "s/=enforcing/=permissive/g" /etc/selinux/config
# fi
# Update to latest packages first
sudo apt -y update
# Install required packages
sudo apt -y install \
python-pip \
zlib1g-dev \
libssl1.0-dev \
wget
# Install pyenv
if [[ $(cat ~/.bashrc) != *PYENV_ROOT* ]]; then
if ! [ -d "$HOME/.pyenv" ] ; then
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
fi
# shellcheck disable=SC2016
# shellcheck disable=SC2129
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
# shellcheck disable=SC2016
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
# shellcheck disable=SC2016
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
fi
if [[ $PATH != *pyenv* ]]; then
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
fi
pyenv install -s 2.7.5
pyenv versions
pyenv global 2.7.5
# There are some packages which are newer in the tripleo repos
# Setup yarn and nodejs repositories
#sudo curl -sL https://dl.yarnpkg.com/rpm/yarn.repo -o /etc/yum.repos.d/yarn.repo
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
#curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# Add this repository to install podman
sudo add-apt-repository -y ppa:projectatomic/ppa
# Add this repository to install Golang 1.12
sudo add-apt-repository -y ppa:longsleep/golang-backports
# Update some packages from new repos
sudo apt -y update
# make sure additional requirments are installed
##No bind-utils. It is for host, nslookop,..., no need in ubuntu
if [[ "${CONTAINER_RUNTIME}" == "podman" ]]; then
sudo apt -y install podman
else
sudo apt -y install \
apt-transport-https \
ca-certificates \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
fi
# Install python packages not included as rpms
sudo pip install \
ansible==2.8.2