Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Ray Milkey | 3492dc1 | 2017-10-25 10:48:35 -0700 | [diff] [blame] | 2 | # Ubuntu base build |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 3 | |
| 4 | # vim: ts=4 sw=4 sts=4 et tw=72 : |
| 5 | |
| 6 | # force any errors to cause the script and job to end in failure |
| 7 | set -xeu -o pipefail |
| 8 | |
| 9 | rh_systems() { |
| 10 | echo 'No changes to apply' |
| 11 | } |
| 12 | |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 13 | |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 14 | ubuntu_systems() { |
| 15 | apt-get clean |
Ray Milkey | 42a199f | 2018-01-08 10:19:49 -0800 | [diff] [blame] | 16 | |
| 17 | # set up docker repo |
| 18 | curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
Ray Milkey | 3dafd60 | 2018-01-08 09:36:55 -0800 | [diff] [blame] | 19 | sudo add-apt-repository \ |
| 20 | "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 21 | $(lsb_release -cs) \ |
| 22 | stable" |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 23 | |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 24 | apt-get update |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 25 | apt-get install -y \ |
| 26 | bzip2 \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 27 | chromium-browser \ |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 28 | curl \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 29 | docker-ce \ |
Zack Williams | f8d5dab | 2020-06-23 15:13:33 -0700 | [diff] [blame] | 30 | enchant \ |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 31 | git \ |
| 32 | less \ |
Zack Williams | 0f67597 | 2020-06-30 22:34:42 -0700 | [diff] [blame] | 33 | libxml2-utils \ |
Ray Milkey | a3809a0 | 2017-10-31 11:21:16 -0700 | [diff] [blame] | 34 | maven \ |
| 35 | nodejs \ |
Ray Milkey | f4fa502 | 2017-11-21 14:52:08 -0800 | [diff] [blame] | 36 | nodejs-legacy \ |
Ray Milkey | a3809a0 | 2017-10-31 11:21:16 -0700 | [diff] [blame] | 37 | npm \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 38 | python \ |
Ray Milkey | 885924b | 2017-12-06 14:12:55 -0800 | [diff] [blame] | 39 | python-pip \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 40 | python-virtualenv \ |
| 41 | rsync \ |
| 42 | ssh \ |
| 43 | zip |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 44 | # end of apt-get install list |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 45 | |
Ray Milkey | f56c9a5 | 2017-11-21 13:29:52 -0800 | [diff] [blame] | 46 | npm install -g bower |
| 47 | npm install karma --save-dev |
Ray Milkey | 3dafd60 | 2018-01-08 09:36:55 -0800 | [diff] [blame] | 48 | |
Zack Williams | fef4927 | 2019-08-28 13:47:09 -0700 | [diff] [blame] | 49 | # clean up |
| 50 | apt-get clean |
| 51 | apt-get purge -y |
| 52 | apt-get autoremove -y |
| 53 | rm -rf /var/lib/apt/lists/* |
Sean Condon | 4eb1026 | 2020-04-30 17:42:33 +0100 | [diff] [blame] | 54 | |
| 55 | BAZELISK_VERSION="1.4.0" |
| 56 | BAZELISK_SHA256SUM="73918095fc6ea94fa60325731412745aa5cbdd963cef1486881830158451d865" |
| 57 | curl -L -o /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64 |
| 58 | echo "$BAZELISK_SHA256SUM /tmp/bazelisk" | sha256sum -c - |
| 59 | mv /tmp/bazelisk /usr/local/bin/bazel |
| 60 | chmod -R a+rx /usr/local/bin/bazel |
| 61 | USE_BAZEL_VERSION=1.2.1 bazel version |
| 62 | USE_BAZEL_VERSION=2.0.0 bazel version |
| 63 | USE_BAZEL_VERSION=3.0.0 bazel version |
| 64 | USE_BAZEL_VERSION=3.1.0 bazel version |
| 65 | mv ~/.cache/bazelisk /usr/local/share/ |
| 66 | chmod -R a+rw /usr/local/share/bazelisk |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 67 | } |
Kailash Khalasi | e0964b1 | 2018-07-10 09:22:00 -0700 | [diff] [blame] | 68 | |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 69 | all_systems() { |
| 70 | echo 'No common distribution configuration to perform' |
| 71 | } |
| 72 | |
| 73 | echo "---> Detecting OS" |
| 74 | ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| 75 | |
| 76 | case "${ORIGIN}" in |
| 77 | fedora|centos|redhat) |
| 78 | echo "---> RH type system detected" |
| 79 | rh_systems |
| 80 | ;; |
| 81 | ubuntu) |
| 82 | echo "---> Ubuntu system detected" |
| 83 | ubuntu_systems |
| 84 | ;; |
| 85 | *) |
| 86 | echo "---> Unknown operating system" |
| 87 | ;; |
| 88 | esac |
| 89 | |
| 90 | # execute steps for all systems |
| 91 | all_systems |