Install Python3.6 for Ubuntu basebuild images
[ci-management.git] / packer / provision / basebuild.sh
index 5801ed6..853afc7 100644 (file)
@@ -3,7 +3,7 @@
 # vim: ts=4 sw=4 sts=4 et tw=72 :
 
 # force any errors to cause the script and job to end in failure
-set -xeu -o pipefile
+set -xeu -o pipefail
 
 rh_systems() {
     # Install python dependencies
@@ -13,7 +13,20 @@ rh_systems() {
     yum install -y openssl-devel mysql-devel gcc
 
     # Autorelease support packages
-    yum install -y xmlstarlet
+    yum install -y firefox python-tox xmlstarlet xvfb
+
+    # Install chrome to support ChromeDriver
+    cat <<EOF > /etc/yum.repos.d/google-chrome.repo
+[google-chrome]
+name=google-chrome
+baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
+enabled=1
+gpgcheck=1
+gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
+EOF
+
+    yum -y update
+    yum -y install google-chrome-stable
 
     # Additional libraries for Python ncclient
     yum install -y libxml2 libxslt libxslt-devel libffi libffi-devel
@@ -40,14 +53,43 @@ rh_systems() {
 }
 
 ubuntu_systems() {
+    # Install python3.6
+    sudo add-apt-repository -y ppa:jonathonf/python-3.6
+    sudo apt-get update
+    sudo apt-get install -y python3.6
+
     # Install python dependencies
     apt-get install -y python-{dev,virtualenv,setuptools,pip}
 
     # Build dependencies for Python packages
     apt-get install -y libssl-dev libmysqlclient-dev gcc
 
+    # Autorelease support packages
+    apt-get install -y firefox python-tox xmlstarlet xvfb
+
+    # Install chrome to support ChromeDriver
+    wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
+    echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
+    apt-get update -y
+    apt-get install -y google-chrome-stable
+
     # Additional libraries for Python ncclient
     apt-get install -y wget unzip python-ncclient
+
+    # Add graphviz for documentation building
+    apt-get install -y graphviz
+
+    # Erlang and Rebar packages needed for DCAEGEN2
+    apt-get install -y libwxgtk3.0-0v5 libsctp1
+    wget https://packages.erlang-solutions.com/erlang/esl-erlang/FLAVOUR_1_general/esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb
+    dpkg -i esl-erlang_19.3.6-1~ubuntu~trusty_amd64.deb
+    apt-get install -y libwxbase3.0-0v5
+    apt-get -f install -y
+    git clone https://github.com/erlang/rebar3.git
+    cd rebar3
+    ./bootstrap
+    mv rebar3 /usr/bin/rebar3
+    cd ..
 }
 
 all_systems() {