blob: e1828940342d7607f24ecda4e74537e70e29bd9c [file] [log] [blame]
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -08001#!/bin/bash
2# Ubuntu base build
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
7set -xeu -o pipefail
8
9rh_systems() {
10 echo 'No changes to apply'
11}
12
Luca Prete962840a2018-03-02 16:39:23 -080013# ubuntu_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# }
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080022
23ubuntu_systems() {
24 apt-get clean
Luca Prete962840a2018-03-02 16:39:23 -080025 # ubuntu_install_java_setup
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080026
27 # set up docker repo
Luca Prete962840a2018-03-02 16:39:23 -080028 # curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
29 # sudo add-apt-repository \
30 # "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
31 # $(lsb_release -cs) \
32 # stable"
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080033
34 apt-get update
35 apt-get install -y \
36 bzip2 \
37 curl \
38 git \
39 less \
Luca Prete962840a2018-03-02 16:39:23 -080040 # oracle-java8-installer \
41 # oracle-java8-set-default \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080042 python \
43 ssh \
44 zip \
Luca Prete962840a2018-03-02 16:39:23 -080045 # maven \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080046 nodejs \
Luca Prete962840a2018-03-02 16:39:23 -080047 # nodejs-legacy \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080048 npm \
49 python-pip \
Luca Prete962840a2018-03-02 16:39:23 -080050 # docker-ce \
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080051 # end of apt-get install list
Luca Prete962840a2018-03-02 16:39:23 -080052 # npm install -g bower
53 # npm install karma --save-dev
Luca Prete9a99c9c2018-03-03 09:03:41 -080054 npm install -g typings
Linux Foundation Administrators1dc9dd52018-01-26 09:09:09 -080055
56 #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
62 echo 'No changes to apply'
63}
64
65all_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