Skip to content

Commit f77a58e

Browse files
committed
install: use git submodules for dependencies
This is helpful for dependencies version management.
1 parent 76f0275 commit f77a58e

File tree

6 files changed

+25
-15
lines changed

6 files changed

+25
-15
lines changed

.gitmodules

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[submodule "nmos-dep/nmos-common"]
2+
path = nmos-dep/nmos-common
3+
url = https://github.com/pkeroulas/nmos-common.git
4+
[submodule "nmos-dep/nmos-reverse-proxy"]
5+
path = nmos-dep/nmos-reverse-proxy
6+
url = https://github.com/pkeroulas/nmos-reverse-proxy.git
7+
[submodule "nmos-dep/nmos-node"]
8+
path = nmos-dep/nmos-node
9+
url = https://github.com/bbc/nmos-node.git
10+
[submodule "nmos-dep/nmos-mdns-bridge"]
11+
path = nmos-dep/nmos-mdns-bridge
12+
url = https://github.com/pkeroulas/nmos-mdns-bridge.git

install.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ set -e
1010
# Install dependencies
1111
apt-get install -y curl git
1212

13-
# Capture the working directory
14-
DIR=$(pwd)
13+
# Capture the top directory
14+
TOP_DIR=$(dirname $(readlink -f $0))
1515

1616
# Add apt repositories for NodeJS and Yarn
1717
curl -sL https://deb.nodesource.com/setup_12.x | bash -
@@ -21,10 +21,6 @@ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.lis
2121
# Install NodeJS and Yarn
2222
apt-get update && apt-get install -y nodejs yarn
2323

24-
# Create and cd into the directory required to run the provision_node script
25-
mkdir -p /home/vagrant
26-
cd /home/vagrant
27-
2824
# Provision a Node
2925
#!/usr/bin/env bash
3026

@@ -48,32 +44,30 @@ apt-get install -y python3 python3-pip python3-mock dh-python \
4844
python-setuptools python-all python3-setuptools python3-stdeb \
4945
python-is-python3
5046

51-
git clone https://github.com/bbc/nmos-common.git
52-
git clone https://github.com/bbc/nmos-reverse-proxy.git
53-
git clone https://github.com/bbc/nmos-node.git
54-
git clone https://github.com/bbc/nmos-mdns-bridge.git
47+
git submodule update --init
48+
NMOS_DEP_DIR=${TOP_DIR}/nmos-dep
5549

56-
cd /home/vagrant/nmos-common
50+
cd ${NMOS_DEP_DIR}/nmos-common
5751
pip3 install -e .
5852
install -m 666 /dev/null /var/log/nmos.log
5953

60-
cd /home/vagrant/nmos-reverse-proxy
54+
cd ${NMOS_DEP_DIR}/nmos-reverse-proxy
6155
sed -i "s/, python3-nmoscommon//" stdeb.cfg
6256
make dsc
6357
mk-build-deps --install deb_dist/nmosreverseproxy_*.dsc --tool "$APT_TOOL"
6458
make deb
6559
dpkg -i dist/python3-nmosreverseproxy_*_all.deb
6660
apt-get -f -y install
6761

68-
cd /home/vagrant/nmos-mdns-bridge
62+
cd ${NMOS_DEP_DIR}/nmos-mdns-bridge
6963
sed -i "s/, python3-nmoscommon//" stdeb.cfg
7064
make dsc
7165
mk-build-deps --install deb_dist/mdnsbridge_*.dsc --tool "$APT_TOOL"
7266
make deb
7367
dpkg -i dist/python3-mdnsbridge_*_all.deb
7468
apt-get -f -y install
7569

76-
cd /home/vagrant/nmos-node
70+
cd ${NMOS_DEP_DIR}/nmos-node
7771
sed -i "s/, python3-nmoscommon//" stdeb.cfg
7872
make dsc
7973
mk-build-deps --install deb_dist/nodefacade_*.dsc --tool "$APT_TOOL"
@@ -84,4 +78,4 @@ apt-get -f -y install
8478
service apache2 restart
8579

8680
# Move back to the starting directory
87-
cd $DIR
81+
cd $TOP_DIR

nmos-dep/nmos-common

Submodule nmos-common added at c9ccff9

nmos-dep/nmos-mdns-bridge

Submodule nmos-mdns-bridge added at 121fd45

nmos-dep/nmos-node

Submodule nmos-node added at 4987c58

nmos-dep/nmos-reverse-proxy

Submodule nmos-reverse-proxy added at faf2a4e

0 commit comments

Comments
 (0)