| #!/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 \ |
| enchant \ |
| git \ |
| less \ |
| libxml2-utils \ |
| maven \ |
| nodejs \ |
| npm \ |
| python \ |
| python-pip \ |
| python-virtualenv \ |
| python3-software-properties \ |
| rsync \ |
| ssh \ |
| zip |
| # end of apt-get install list |
| |
| npm install -g npm@latest # update npm to latest version, since apt doesn't fetch latest |
| 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/* |
| |
| BAZELISK_VERSION="1.11.0" |
| BAZELISK_SHA256SUM="231ec5ca8115e94c75a1f4fbada1a062b48822ca04f21f26e4cb1cd8973cd458" |
| curl -L -o /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64 |
| echo "$BAZELISK_SHA256SUM /tmp/bazelisk" | sha256sum -c - |
| mv /tmp/bazelisk /usr/local/bin/bazel |
| chmod -R a+rx /usr/local/bin/bazel |
| USE_BAZEL_VERSION=3.7.2 bazel version |
| USE_BAZEL_VERSION=6.0.0-pre.20220421.3 bazel version |
| mv ~/.cache/bazelisk /usr/local/share/ |
| chmod -R a+rw /usr/local/share/bazelisk |
| } |
| |
| 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 |