Skip to content

Commit

Permalink
install: use git submodules for dependencies
Browse files Browse the repository at this point in the history
This is helpful for dependencies version management.
  • Loading branch information
pkeroulas committed Mar 22, 2022
1 parent 76f0275 commit f77a58e
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "nmos-dep/nmos-common"]
path = nmos-dep/nmos-common
url = https://github.com/pkeroulas/nmos-common.git
[submodule "nmos-dep/nmos-reverse-proxy"]
path = nmos-dep/nmos-reverse-proxy
url = https://github.com/pkeroulas/nmos-reverse-proxy.git
[submodule "nmos-dep/nmos-node"]
path = nmos-dep/nmos-node
url = https://github.com/bbc/nmos-node.git
[submodule "nmos-dep/nmos-mdns-bridge"]
path = nmos-dep/nmos-mdns-bridge
url = https://github.com/pkeroulas/nmos-mdns-bridge.git
24 changes: 9 additions & 15 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ set -e
# Install dependencies
apt-get install -y curl git

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

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

# Create and cd into the directory required to run the provision_node script
mkdir -p /home/vagrant
cd /home/vagrant

# Provision a Node
#!/usr/bin/env bash

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

git clone https://github.com/bbc/nmos-common.git
git clone https://github.com/bbc/nmos-reverse-proxy.git
git clone https://github.com/bbc/nmos-node.git
git clone https://github.com/bbc/nmos-mdns-bridge.git
git submodule update --init
NMOS_DEP_DIR=${TOP_DIR}/nmos-dep

cd /home/vagrant/nmos-common
cd ${NMOS_DEP_DIR}/nmos-common
pip3 install -e .
install -m 666 /dev/null /var/log/nmos.log

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

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

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

# Move back to the starting directory
cd $DIR
cd $TOP_DIR
1 change: 1 addition & 0 deletions nmos-dep/nmos-common
Submodule nmos-common added at c9ccff
1 change: 1 addition & 0 deletions nmos-dep/nmos-mdns-bridge
Submodule nmos-mdns-bridge added at 121fd4
1 change: 1 addition & 0 deletions nmos-dep/nmos-node
Submodule nmos-node added at 4987c5
1 change: 1 addition & 0 deletions nmos-dep/nmos-reverse-proxy
Submodule nmos-reverse-proxy added at faf2a4

0 comments on commit f77a58e

Please sign in to comment.