blob: 5af75bc79bcacc2541e47c5725c5d4a13ff55798 [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 \
36 npm \
Zack Williams3403ff42019-08-13 18:30:42 -070037 python \
Ray Milkey885924b2017-12-06 14:12:55 -080038 python-pip \
Zack Williams3403ff42019-08-13 18:30:42 -070039 python-virtualenv \
40 rsync \
41 ssh \
42 zip
Brian O'Connor476369f2017-10-18 16:36:33 -070043 # end of apt-get install list
Zack Williams3403ff42019-08-13 18:30:42 -070044
Ray Milkeyf56c9a52017-11-21 13:29:52 -080045 npm install -g bower
46 npm install karma --save-dev
Ray Milkey3dafd602018-01-08 09:36:55 -080047
Zack Williamsfef49272019-08-28 13:47:09 -070048 # clean up
49 apt-get clean
50 apt-get purge -y
51 apt-get autoremove -y
52 rm -rf /var/lib/apt/lists/*
Sean Condon4eb10262020-04-30 17:42:33 +010053
pierventre01745572022-05-17 09:41:15 +020054 BAZELISK_VERSION="1.11.0"
55 BAZELISK_SHA256SUM="231ec5ca8115e94c75a1f4fbada1a062b48822ca04f21f26e4cb1cd8973cd458"
Sean Condon4eb10262020-04-30 17:42:33 +010056 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
pierventre01745572022-05-17 09:41:15 +020060 USE_BAZEL_VERSION=3.7.2 bazel version
61 USE_BAZEL_VERSION=6.0.0-pre.20220421.3 bazel version
Sean Condon4eb10262020-04-30 17:42:33 +010062 mv ~/.cache/bazelisk /usr/local/share/
63 chmod -R a+rw /usr/local/share/bazelisk
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070064}
Kailash Khalasie0964b12018-07-10 09:22:00 -070065
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070066all_systems() {
67 echo 'No common distribution configuration to perform'
68}
69
70echo "---> Detecting OS"
71ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
72
73case "${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 ;;
85esac
86
87# execute steps for all systems
88all_systems