-
Notifications
You must be signed in to change notification settings - Fork 3
/
buildRunEnv.sh
executable file
·47 lines (31 loc) · 1.21 KB
/
buildRunEnv.sh
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
#!/bin/bash
if [ -f ./common.sh ]
then
source ./common.sh
export MANDATORY="UBUNTU BUILD"
chk_args "$@"
export UBUNTU_VERSION_CHOSEN=0
for i in focal bionic
do
if [ "${UBUNTU}" == "${i}" ]
then
export UBUNTU_VERSION_CHOSEN=1
fi
done
export BUILD_TYPE_CHOSEN=0
for i in avx avx2 ssse3 sse2
do
if [ "${BUILD}" == "${i}" ]
then
export BUILD_TYPE_CHOSEN=1
fi
done
[ ${UBUNTU_VERSION_CHOSEN} -eq 1 ] || die "Use --ubuntu {focal|bionic} - only these two ubuntu versions are supported"
[ ${BUILD_TYPE_CHOSEN} -eq 1 ] || die "Use --build {avx2|ssse3|sse2} - only these two build types are supported"
[ -f ./VERSION ] || die "No VERSION file in current directory"
export VERSION=$(cat ./VERSION)
sed -e "s/XX_VERSION_XX/$VERSION/g;s/MTUNE/$BUILD/g;s/URELEASE/$UBUNTU/g" dockerfiles/Dockerfile.lapps-runenv.template > dockerfiles/Dockerfile.lapps-runenv.${VERSION}.${UBUNTU}.${BUILD}
docker build -t lapps:runenv.${VERSION}.${UBUNTU}.${BUILD} -f dockerfiles/Dockerfile.lapps-runenv.${VERSION}.${UBUNTU}.${BUILD} --force-rm .
else
echo "This file is supposed to be executed from within the LAppS build directory (clone of https://github.com/ITpC/LAppS.git)"
fi