#!/bin/bash
cd browser-extension/ 
npm install

export HOST_ADDR="www.aifex.fr"
export PROTOCOL="https"

export CERTIFICAT_SOURCE="/etc/aifexcert"
export CERTIFICAT_TARGET="/etc/aifexcert"

export NODE_ENV="production"

export PLUGIN_INFO=$(node -e 'console.log(JSON.stringify(require("./src/manifest.chrome.json")))')

npm run production 
cd dist/firefox
zip -r ../../firefoxExtension .
cd ..
rm -fr firefox
zip -r ../chromeExtension ./chrome
cd ..
mv -f chromeExtension.zip ../dashboard/public
mv -f firefoxExtension.zip ../dashboard/public
cd ..


docker-compose -f docker-compose.yml -f docker-compose.production-cis.yml up --build

