diff --git a/.bin/build-all.sh b/.bin/build-all.sh new file mode 100644 index 00000000..3c3698ab --- /dev/null +++ b/.bin/build-all.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Workaround for running from Git Bash on Windows: +export MSYS_NO_PATHCONV=1 + +script_path=$(realpath "$0") +script_dir=$(dirname "$script_path") +project_root=$(dirname "$script_dir") + +work_dir="/usr/src/verapdf-webapp-server" + +# Build all project sources +docker run -it \ + --rm --name build-verapdf-webapp-server \ + -v maven-repo:/root/.m2 \ + -v "$project_root":$work_dir \ + -w $work_dir \ + maven:3.6-jdk-11 mvn clean package diff --git a/.bin/init.sh b/.bin/init.sh new file mode 100644 index 00000000..82db2cb3 --- /dev/null +++ b/.bin/init.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +# Create a volume to reuse downloaded maven dependencies +docker volume create --name maven-repo diff --git a/README.md b/README.md index 12b322b0..72ff9177 100644 --- a/README.md +++ b/README.md @@ -8,10 +8,18 @@ JDK 11, Maven, Docker **Build sources** +You can use your local Maven installation to build project sources: ``` mvn clean install ``` +Alternatively you can use a docker maven image. +For that you need first initialize the volume to re-use maven repo between runs: +``` +.bin/init.sh +``` +After that you can use `.bin/build-all.sh` script to run actual building. + ## Running in Docker **Run service stack**