| #!/bin/bash |
| # Ubuntu base build |
| |
| # 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 pipefail |
| |
| rh_systems() { |
| echo 'No changes to apply' |
| } |
| |
| |
| ubuntu_systems() { |
| apt-get clean |
| |
| # set up docker repo |
| 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" |
| |
| apt-get update |
| apt-get install -y \ |
| bzip2 \ |
| chromium-browser \ |
| curl \ |
| docker-ce \ |
| git \ |
| less \ |
| maven \ |
| nodejs \ |
| nodejs-legacy \ |
| npm \ |
| python \ |
| python-pip \ |
| python-virtualenv \ |
| rsync \ |
| ssh \ |
| zip |
| # end of apt-get install list |
| |
| npm install -g bower |
| npm install karma --save-dev |
| |
| # clean up |
| apt-get clean |
| apt-get purge -y |
| apt-get autoremove -y |
| rm -rf /var/lib/apt/lists/* |
| } |
| |
| all_systems() { |
| echo 'No common distribution configuration to perform' |
| } |
| |
| echo "---> Detecting OS" |
| ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| |
| case "${ORIGIN}" in |
| fedora|centos|redhat) |
| echo "---> RH type system detected" |
| rh_systems |
| ;; |
| ubuntu) |
| echo "---> Ubuntu system detected" |
| ubuntu_systems |
| ;; |
| *) |
| echo "---> Unknown operating system" |
| ;; |
| esac |
| |
| # execute steps for all systems |
| all_systems |