diff --git a/.editorconfig b/.editorconfig index 6dc823c..9237973 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,6 +9,6 @@ insert_final_newline = true tab_width = 4 trim_trailing_whitespace = true -[*.{xml,yml}] +[*.{sh,xml,yml}] indent_size = 2 indent_style = space diff --git a/README.md b/README.md index c3f2141..4d341c9 100644 --- a/README.md +++ b/README.md @@ -358,6 +358,15 @@ System Lambda supports [GitHub Actions](https://help.github.com/en/actions) integration. Your pull request will be automatically built by both CI servers. +### Build with Docker + +The script + + ./scripts/mvn_in_docker.sh clean verify -Dgpg.skip + +builds System Lambda inside a Docker container. It uses your Maven local +repository. This is helpful if you have a Linux or macOS without JDK 8. + ## Release Guide diff --git a/pom.xml b/pom.xml index d965d3f..19b45bc 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ system-lambda - 1.2.0 + 1.3.0-SNAPSHOT jar System Lambda diff --git a/scripts/mvn_in_docker.sh b/scripts/mvn_in_docker.sh new file mode 100755 index 0000000..e6e5eb8 --- /dev/null +++ b/scripts/mvn_in_docker.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Executes Maven inside a Docker container with Java 8. The image has to be +# executed with options, phases and goals just like the original mvn command. +# E.g. instead of "mvn verify" you have to execute +# +# scripts/mvn_in_docker.sh verify +# +# from the project directory. The user's Maven local repository is used by the +# container. + +set -euxo pipefail + +readonly group=`id -g` +readonly user=`id -u` + +docker run \ + --rm \ + -e MAVEN_CONFIG=/var/maven/.m2 \ + -u "$user:$group" \ + -v "$(pwd)":/usr/src/system-lambda \ + -v ~/.m2:/var/maven/.m2 \ + -w /usr/src/system-lambda \ + maven:3.8.1-openjdk-8-slim \ + mvn -Duser.home=/var/maven "$@" +rm -r '?/' # I don't know why this directory is created.