-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·29 lines (23 loc) · 1006 Bytes
/
build.sh
File metadata and controls
executable file
·29 lines (23 loc) · 1006 Bytes
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
29
#!/bin/bash
###########################################################################################
# Builds project in a docker container that contains all necessary environment.
###########################################################################################
# See: https://sipb.mit.edu/doc/safe-shell/
set -e
set -u
. ./build.include
init "$@"
DEFAULT_MVN_REPO=${HOME}/.m2/repository
if command -v mvn >/dev/null 2>&1; then
MVN_REPO=$(mvn help:evaluate -Dexpression=settings.localRepository | grep -E '^([a-zA-Z]:|/)')
echo "Detected Maven, mounting local repo at ${MVN_REPO}"
else
MVN_REPO=${DEFAULT_MVN_REPO}
echo "Maven not detected, mounting local repo at default path: ${DEFAULT_MVN_REPO}";
fi
docker_exec run -it --rm --name build-che \
-v "$MVN_REPO:/home/user/.m2/repository" \
-v "$PWD":/home/user/che-build \
-w /home/user/che-build \
codenvy/che-dev \
mvn clean install