forked from forj-oss/forjj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
inenv
executable file
·53 lines (43 loc) · 1.17 KB
/
inenv
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
# This file is generated by BuildEnv. Avoid updating it manually.
# Instead, contribute to BuildEnv and use 'be_update'
#
MOD=core
# From BuildEnv bin/pre-wrapper.sh
BUILD_SCRIPT_PATH=$(dirname $0)
BUILD_SCRIPT_LIB_PATH=$(dirname $BUILD_SCRIPT_PATH)/lib
if [[ ! -f $BUILD_SCRIPT_LIB_PATH/run-build-env.sh ]]
then
echo "Unable to load build-env.sh. '$BUILD_SCRIPT_LIB_PATH/run-build-env.sh' not found"
exit 1
fi
source $BUILD_SCRIPT_LIB_PATH/run-build-env.sh
# Added from ../build-env/bin/inenv
# From BuildEnv bin/inenv.sh
if [[ "$1" == --help ]]
then
echo "usage is inenv [module]
inenv is used to enter in the builder module container with bash to get build context."
exit
fi
if [[ -f $BUILD_ENV_PROJECT/build-env.modules ]]
then
MODS=(`cat $BUILD_ENV_PROJECT/build-env.modules`)
case ${#MODS[@]} in
0) IMAGE=alpine ;;
1) IMAGE="${BE_PROJECT}-${MODS[0]}-env" ; MOD=${MODS[0]};;
*)
for MOD in ${MODS[@]}
do
if [[ $MOD = $1 ]]
then
IMAGE="${BE_PROJECT}-$1-env"
break
fi
done
;;
esac
else
IMAGE=alpine
fi
docker_run $IMAGE bash