From 7219b778f33b0f4a10a536ab4f5ea4dedd439aa5 Mon Sep 17 00:00:00 2001 From: Javier Arroyo Date: Thu, 31 Aug 2023 14:19:49 +0200 Subject: [PATCH] Add shortcuts to build and run website environment. --- web/makefile | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/web/makefile b/web/makefile index 533610ed3..a7727985e 100644 --- a/web/makefile +++ b/web/makefile @@ -1,3 +1,33 @@ +# Set $ROOT to top-level directory of the repository +ROOT ?= $(shell dirname \ + $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))) + +IMG_NAME=boptestweb +IMG_HOME=/home + +build-env: + docker build -f ${ROOT}/web/Dockerfile \ + --platform=linux/amd64 \ + --progress=plain --rm -t ${IMG_NAME} ../ + +build-env-no-cache: + docker build -f ${ROOT}/web/Dockerfile \ + --platform=linux/amd64 \ + --no-cache \ + --progress=plain --rm -t ${IMG_NAME} ../ + +run-build-and-test: + docker run \ + --name ${IMG_NAME} \ + --platform=linux/amd64 \ + --detach=false \ + --network=host \ + --rm \ + -v ${ROOT}:${IMG_HOME}/boptest:rw \ + -w ${IMG_HOME}/boptest/web \ + -it \ + ${IMG_NAME} /bin/bash -c "make build_and_test" + build_and_test: ./build_docs.sh bundle exec jekyll serve