#!/bin/bash
cd chrome-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.json")))')

npm run production 
zip -r dist.zip ./dist
mv dist.zip ../dashboard/public
cd ..

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

