Skip to content

Commit

Permalink
Add script to build project sources using maven docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliya-ivaniukovich committed Apr 17, 2020
1 parent 50b7121 commit 7f84f75
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .bin/build-all.sh
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .bin/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash
# Create a volume to reuse downloaded maven dependencies
docker volume create --name maven-repo
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**
Expand Down

0 comments on commit 7f84f75

Please sign in to comment.