-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmvn.sh
More file actions
executable file
·28 lines (26 loc) · 1.14 KB
/
Copy pathmvn.sh
File metadata and controls
executable file
·28 lines (26 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
export MAVEN_IMAGE=brunoe/maven:3.8.6-eclipse-temurin-17
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CURRENT=$(pwd)
echo SCRIPT_DIR=$SCRIPT_DIR
echo PWD=$CURRENT
# mount the gh action directory in the container
docker run \
--env GITHUBLOGIN=$GITHUBLOGIN \
--env GITHUBTOKEN=$GITHUBTOKEN \
--mount type=bind,source=${HOME}/.m2,target=/home/user/.m2 \
--mount type=bind,source=${HOME}/.sonar,target=/home/user/.sonar \
--mount type=bind,source=${HOME}/.ssh,target=/home/user/.ssh \
--mount type=bind,source=${HOME}/.gitconfig,target=/home/user/.gitconfig,readonly \
--mount type=bind,source="$(pwd)",target=/usr/src/mymaven \
--mount type=bind,source=${SCRIPT_DIR},target=/usr/local/mvn-wrapper-dir \
--workdir /usr/src/mymaven \
--rm \
--env PUID=`id -u` -e PGID=`id -g` \
--env MAVEN_CONFIG=/var/maven/.m2 \
$MAVEN_IMAGE \
runuser --user user \
--group user \
-- mvn -B -e -T 1C \
-Duser.home=/home/user \
--settings /usr/local/mvn-wrapper-dir/ci-settings.xml "$@"