blob: 18c53bd229bc53c809e4dfebf9823f4c617c28fb [file] [log] [blame]
Andrew Grimberg78bc6d52017-10-13 12:55:05 -07001#!/bin/bash
Ray Milkey3492dc12017-10-25 10:48:35 -07002# Ubuntu base build
Andrew Grimberg78bc6d52017-10-13 12:55:05 -07003
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
7set -xeu -o pipefail
8
9rh_systems() {
10 echo 'No changes to apply'
11}
12
Brian O'Connor476369f2017-10-18 16:36:33 -070013
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070014ubuntu_systems() {
15 apt-get clean
Ray Milkey42a199f2018-01-08 10:19:49 -080016
17 # set up docker repo
18 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Ray Milkey3dafd602018-01-08 09:36:55 -080019 sudo add-apt-repository \
20 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
21 $(lsb_release -cs) \
22 stable"
Zack Williams3403ff42019-08-13 18:30:42 -070023
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070024 apt-get update
Brian O'Connor476369f2017-10-18 16:36:33 -070025 apt-get install -y \
26 bzip2 \
Zack Williams3403ff42019-08-13 18:30:42 -070027 chromium-browser \
Brian O'Connor476369f2017-10-18 16:36:33 -070028 curl \
Zack Williams3403ff42019-08-13 18:30:42 -070029 docker-ce \
Zack Williamsf8d5dab2020-06-23 15:13:33 -070030 enchant \
Brian O'Connor476369f2017-10-18 16:36:33 -070031 git \
32 less \
Zack Williams0f675972020-06-30 22:34:42 -070033 libxml2-utils \
Ray Milkeya3809a02017-10-31 11:21:16 -070034 maven \
35 nodejs \
Ray Milkeyf4fa5022017-11-21 14:52:08 -080036 nodejs-legacy \
Ray Milkeya3809a02017-10-31 11:21:16 -070037 npm \
Zack Williams3403ff42019-08-13 18:30:42 -070038 python \
Ray Milkey885924b2017-12-06 14:12:55 -080039 python-pip \
Zack Williams3403ff42019-08-13 18:30:42 -070040 python-virtualenv \
41 rsync \
42 ssh \
43 zip
Brian O'Connor476369f2017-10-18 16:36:33 -070044 # end of apt-get install list
Zack Williams3403ff42019-08-13 18:30:42 -070045
Ray Milkeyf56c9a52017-11-21 13:29:52 -080046 npm install -g bower
47 npm install karma --save-dev
Ray Milkey3dafd602018-01-08 09:36:55 -080048
Zack Williamsfef49272019-08-28 13:47:09 -070049 # clean up
50 apt-get clean
51 apt-get purge -y
52 apt-get autoremove -y
53 rm -rf /var/lib/apt/lists/*
Sean Condon4eb10262020-04-30 17:42:33 +010054
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 Grimberg78bc6d52017-10-13 12:55:05 -070067}
Kailash Khalasie0964b12018-07-10 09:22:00 -070068
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070069all_systems() {
70 echo 'No common distribution configuration to perform'
71}
72
73echo "---> Detecting OS"
74ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
75
76case "${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 ;;
88esac
89
90# execute steps for all systems
91all_systems