#!/bin/sh

if [ "x$1" == "xdocker" ] ; then
	docker build --rm -t hexasoftware.com:5000/myapp .
	exit
fi

mkdir -p DIST/bin
mkdir -p DIST/public

echo "Building backend..."
# Backend
pushd DIST/bin
CGO_ENABLED=0 go build  ../../backend/src/cmd/simple-cli
CGO_ENABLED=0 go build ../../backend/src/cmd/server
popd

echo "Building frontend..."
# Frontend
pushd frontend/web
node build/build.js
popd


