blob: acd92a88298fc7faa94f189544e6cdbfadc42aae [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 -070013ubuntu_install_java_setup() {
14 DISTRO="xenial" # TODO get this programatically
15 echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
16 echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu $DISTRO main" | \
17 tee /etc/apt/sources.list.d/webupd8team-java.list
18 echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu $DISTRO main" | \
19 tee -a /etc/apt/sources.list.d/webupd8team-java.list
20 apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
21}
22
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070023ubuntu_systems() {
24 apt-get clean
Brian O'Connor476369f2017-10-18 16:36:33 -070025 ubuntu_install_java_setup
Ray Milkey42a199f2018-01-08 10:19:49 -080026
27 # set up docker repo
28 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Ray Milkey3dafd602018-01-08 09:36:55 -080029 sudo add-apt-repository \
30 "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
31 $(lsb_release -cs) \
32 stable"
Ray Milkey42a199f2018-01-08 10:19:49 -080033
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070034 apt-get update
Brian O'Connor476369f2017-10-18 16:36:33 -070035 apt-get install -y \
36 bzip2 \
37 curl \
38 git \
39 less \
40 oracle-java8-installer \
41 oracle-java8-set-default \
42 python \
43 ssh \
44 zip \
Ray Milkeya3809a02017-10-31 11:21:16 -070045 maven \
46 nodejs \
Ray Milkeyf4fa5022017-11-21 14:52:08 -080047 nodejs-legacy \
Ray Milkeya3809a02017-10-31 11:21:16 -070048 npm \
Ray Milkey885924b2017-12-06 14:12:55 -080049 python-pip \
Ray Milkey42a199f2018-01-08 10:19:49 -080050 docker-ce \
Kailash Khalasi87530842018-06-19 12:38:23 -070051 chromium-browser \
Brian O'Connor476369f2017-10-18 16:36:33 -070052 # end of apt-get install list
Ray Milkeyf56c9a52017-11-21 13:29:52 -080053 npm install -g bower
54 npm install karma --save-dev
Ray Milkey3dafd602018-01-08 09:36:55 -080055
Brian O'Connor476369f2017-10-18 16:36:33 -070056 #TODO clean up
57 #apt-get clean
58 #apt-get purge -y
59 #apt-get autoremove -y
60 #rm -rf /var/lib/apt/lists/*
61 #rm -rf /var/cache/oracle-jdk8-installer
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070062 echo 'No changes to apply'
63}
Kailash Khalasie0964b12018-07-10 09:22:00 -070064
Andrew Grimberg78bc6d52017-10-13 12:55:05 -070065all_systems() {
66 echo 'No common distribution configuration to perform'
67}
68
69echo "---> Detecting OS"
70ORIGIN=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
71
72case "${ORIGIN}" in
73 fedora|centos|redhat)
74 echo "---> RH type system detected"
75 rh_systems
76 ;;
77 ubuntu)
78 echo "---> Ubuntu system detected"
79 ubuntu_systems
80 ;;
81 *)
82 echo "---> Unknown operating system"
83 ;;
84esac
85
86# execute steps for all systems
87all_systems