#
# Copyright (c) 2021, Patrik Brosz
#

echo -e "\n--- React - downloading and configuring ---\n"
sudo apt-get update >> /vagrant/vm_build.log 2>&1
curl -sL https://deb.nodesource.com/setup_14.x | sudo bash - >> /vagrant/vm_build.log 2>&1
sudo apt -y install nodejs >> /vagrant/vm_build.log 2>&1
cd /vagrant/frontend/
npm install >> /vagrant/vm_build.log 2>&1
npm audit fix >> /vagrant/vm_build.log 2>&1
npm run build >> /vagrant/vm_build.log 2>&1
sudo npm install -g serve >> /vagrant/vm_build.log 2>&1


echo -e "\n--- Django - downloading and configuring ---\n"
sudo apt-get install -y python3 >> /vagrant/vm_build.log 2>&1
sudo apt-get install -y python3-pip >> /vagrant/vm_build.log 2>&1
sudo pip3 install pipenv >> /vagrant/vm_build.log 2>&1