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 \ |
| 36 | npm \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 37 | python \ |
Ray Milkey | 885924b | 2017-12-06 14:12:55 -0800 | [diff] [blame] | 38 | python-pip \ |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 39 | python-virtualenv \ |
| 40 | rsync \ |
| 41 | ssh \ |
| 42 | zip |
Brian O'Connor | 476369f | 2017-10-18 16:36:33 -0700 | [diff] [blame] | 43 | # end of apt-get install list |
Zack Williams | 3403ff4 | 2019-08-13 18:30:42 -0700 | [diff] [blame] | 44 | |
Ray Milkey | f56c9a5 | 2017-11-21 13:29:52 -0800 | [diff] [blame] | 45 | npm install -g bower |
| 46 | npm install karma --save-dev |
Ray Milkey | 3dafd60 | 2018-01-08 09:36:55 -0800 | [diff] [blame] | 47 | |
Zack Williams | fef4927 | 2019-08-28 13:47:09 -0700 | [diff] [blame] | 48 | # clean up |
| 49 | apt-get clean |
| 50 | apt-get purge -y |
| 51 | apt-get autoremove -y |
| 52 | rm -rf /var/lib/apt/lists/* |
Sean Condon | 4eb1026 | 2020-04-30 17:42:33 +0100 | [diff] [blame] | 53 | |
pierventre | 0174557 | 2022-05-17 09:41:15 +0200 | [diff] [blame] | 54 | BAZELISK_VERSION="1.11.0" |
| 55 | BAZELISK_SHA256SUM="231ec5ca8115e94c75a1f4fbada1a062b48822ca04f21f26e4cb1cd8973cd458" |
Sean Condon | 4eb1026 | 2020-04-30 17:42:33 +0100 | [diff] [blame] | 56 | curl -L -o /tmp/bazelisk https://github.com/bazelbuild/bazelisk/releases/download/v${BAZELISK_VERSION}/bazelisk-linux-amd64 |
| 57 | echo "$BAZELISK_SHA256SUM /tmp/bazelisk" | sha256sum -c - |
| 58 | mv /tmp/bazelisk /usr/local/bin/bazel |
| 59 | chmod -R a+rx /usr/local/bin/bazel |
pierventre | 0174557 | 2022-05-17 09:41:15 +0200 | [diff] [blame] | 60 | USE_BAZEL_VERSION=3.7.2 bazel version |
| 61 | USE_BAZEL_VERSION=6.0.0-pre.20220421.3 bazel version |
Sean Condon | 4eb1026 | 2020-04-30 17:42:33 +0100 | [diff] [blame] | 62 | mv ~/.cache/bazelisk /usr/local/share/ |
| 63 | chmod -R a+rw /usr/local/share/bazelisk |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 64 | } |
Kailash Khalasi | e0964b1 | 2018-07-10 09:22:00 -0700 | [diff] [blame] | 65 | |
Andrew Grimberg | 78bc6d5 | 2017-10-13 12:55:05 -0700 | [diff] [blame] | 66 | all_systems() { |
| 67 | echo 'No common distribution configuration to perform' |
| 68 | } |
| 69 | |
| 70 | echo "---> Detecting OS" |
| 71 | ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]') |
| 72 | |
| 73 | case "${ORIGIN}" in |
| 74 | fedora|centos|redhat) |
| 75 | echo "---> RH type system detected" |
| 76 | rh_systems |
| 77 | ;; |
| 78 | ubuntu) |
| 79 | echo "---> Ubuntu system detected" |
| 80 | ubuntu_systems |
| 81 | ;; |
| 82 | *) |
| 83 | echo "---> Unknown operating system" |
| 84 | ;; |
| 85 | esac |
| 86 | |
| 87 | # execute steps for all systems |
| 88 | all_systems |