-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for running Maven in Docker
System Lambda cannot be build with newer JDKs, but some developers don't have JDK 8 installed anymore. The new scripts allows them to build System Lambda without having JDK 8 as long as they have Docker installed.
- Loading branch information
1 parent
a203454
commit d3ce0eb
Showing
4 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |