|
| 1 | +#!/usr/bin/env bash |
| 2 | + |
| 3 | +# +----------------------------------------------------------+ |
| 4 | +# | BASH : Modifying Shell Behaviour |
| 5 | +# | (https://www.gnu.org/software/bash/manual) |
| 6 | +# +----------------------------------------------------------+ |
| 7 | +# Treat unset variables and parameters other than the special |
| 8 | +# parameters ‘@’ or ‘*’ as an error when performing parameter |
| 9 | +# expansion. An error message will be written to the standard |
| 10 | +# error, and a non-interactive shell will exit. |
| 11 | +set -o nounset |
| 12 | + |
| 13 | +# Exit immediately if a pipeline returns a non-zero status. |
| 14 | +set -o errexit |
| 15 | + |
| 16 | +# If set, the return value of a pipeline is the value of the |
| 17 | +# last (rightmost) command to exit with a non-zero status, or |
| 18 | +# zero if all commands in the pipeline exit successfully. |
| 19 | +set -o pipefail |
| 20 | + |
| 21 | +# +----------------------------------------------------------+ |
| 22 | +export DEBIAN_FRONTEND=noninteractive |
| 23 | + |
| 24 | +apt-get update |
| 25 | + |
| 26 | +# setup locales in the container so Python can default to utf-8. |
| 27 | +apt-get -y install locales |
| 28 | +# from http://jaredmarkell.com/docker-and-locales/ |
| 29 | +locale-gen en_US.UTF-8 |
| 30 | +export ENV LANG=en_US.UTF-8 |
| 31 | +export ENV LANGUAGE=en_US:en |
| 32 | +export ENV LC_ALL=en_US.UTF-8 |
| 33 | + |
| 34 | +apt-get -y install software-properties-common |
| 35 | +apt-get -y install git |
| 36 | +apt-get -y install curl |
| 37 | +apt-get -y install unzip |
| 38 | + |
| 39 | +# deadsnakes maintains a bunch of python versions for Ubuntu. |
| 40 | +add-apt-repository -y ppa:deadsnakes/ppa |
| 41 | +apt-get update |
| 42 | +apt-get -y install python3.5 |
| 43 | +apt-get -y install python3.6 |
| 44 | +apt-get -y install python3.7 |
| 45 | +apt-get -y install python3.8 |
| 46 | +apt-get -y install python3-pip |
| 47 | +pip3 install tox |
| 48 | + |
| 49 | +# Node.js (13), npm (6.14) and JS dependencies |
| 50 | +curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash - |
| 51 | +apt-get -y install nodejs |
| 52 | +node -v |
| 53 | +npm -v |
| 54 | +# install JSdoc to be used with sphinx-js |
| 55 | +npm install -g jsdoc |
| 56 | +# install Mocha JavaScript test framework |
| 57 | +npm install -g mocha |
| 58 | + |
| 59 | +# Sonarqube |
| 60 | +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip |
| 61 | +unzip -o $HOME/.sonar/sonar-scanner.zip -d $SONAR_SCANNER_HOME |
| 62 | + |
| 63 | +rm -rf $HOME/.sonar |
| 64 | + |
| 65 | +echo "export PATH=$PATH" >> ~/.bashrc |
| 66 | +echo "export LANG=en_US.UTF-8" >> ~/.bashrc |
| 67 | +echo "export LANGUAGE=en_US:en" >> ~/.bashrc |
| 68 | +echo "export LC_ALL=en_US.UTF-8" >> ~/.bashrc |
0 commit comments