11#! /bin/bash
2+
23if [ " $EUID " -ne 0 ]
34 then echo " Please run as root"
45 exit
@@ -11,15 +12,15 @@ apt-get install -y curl git
1112DIR=$( pwd)
1213
1314# Add apt repositories for NodeJS and Yarn
14- curl -sL https://deb.nodesource.com/setup_8 .x | sudo -E bash -
15- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
16- echo " deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
15+ curl -sL https://deb.nodesource.com/setup_12 .x | -E bash -
16+ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
17+ echo " deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
1718
1819# Install NodeJS and Yarn
1920apt-get update && apt-get install -y nodejs yarn
2021
2122# Create and cd into the directory required to run the provision_node script
22- mkdir /home/vagrant
23+ mkdir -p /home/vagrant
2324cd /home/vagrant
2425
2526# Provision a Node
@@ -31,14 +32,14 @@ APT_TOOL='apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y'
3132
3233# All service are run as an ipstudio user
3334useradd ipstudio
34- mkdir /home/ipstudio
35+ mkdir -p /home/ipstudio
3536chown -R ipstudio /home/ipstudio
3637
3738sed -i ' s/# deb-src/deb-src/' /etc/apt/sources.list
3839apt-get update
39- apt-get install python3-pip python3-mock devscripts debhelper equivs python3-setuptools python-stdeb python3 tox -y
40-
41- cd /home/vagrant
40+ apt-get install python3-pip python3-mock devscripts debhelper equivs \
41+ dh-python python-setuptools python-all apache2-dev dh-systemd \
42+ python3-setuptools python-stdeb python3 tox -y
4243
4344git clone https://github.com/bbc/nmos-common.git
4445git clone https://github.com/bbc/nmos-reverse-proxy.git
@@ -55,23 +56,23 @@ make dsc
5556mk-build-deps --install deb_dist/nmosreverseproxy_* .dsc --tool " $APT_TOOL "
5657make deb
5758dpkg -i dist/python3-nmosreverseproxy_* _all.deb
58- sudo apt-get -f -y install
59+ apt-get -f -y install
5960
6061cd /home/vagrant/nmos-mdns-bridge
6162sed -i " s/, python3-nmoscommon//" stdeb.cfg
6263make dsc
6364mk-build-deps --install deb_dist/mdnsbridge_* .dsc --tool " $APT_TOOL "
6465make deb
6566dpkg -i dist/python3-mdnsbridge_* _all.deb
66- sudo apt-get -f -y install
67+ apt-get -f -y install
6768
6869cd /home/vagrant/nmos-node
6970sed -i " s/, python3-nmoscommon//" stdeb.cfg
7071make dsc
7172mk-build-deps --install deb_dist/nodefacade_* .dsc --tool " $APT_TOOL "
7273make deb
7374dpkg -i dist/python3-nodefacade_* _all.deb
74- sudo apt-get -f -y install
75+ apt-get -f -y install
7576
7677service apache2 restart
7778
0 commit comments