-
Notifications
You must be signed in to change notification settings - Fork 3
/
runDockerBuild
executable file
·48 lines (34 loc) · 1.28 KB
/
runDockerBuild
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
#!/bin/bash
if [ -f ./common.sh ]
then
source ./common.sh
export MANDATORY="UBUNTU BUILD"
chk_args "$@"
export UBUNTU_VERSION_CHOSEN=0
for i in bionic focal
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} ] || die "Use --ubuntu {bionic|focal}"
[ ${BUILD_TYPE_CHOSEN} ] || die "Use --build {avx|avx2|ssse3|sse2}"
[ -f ./VERSION ] || die "No VERSION file in current directory"
export VERSION=$(cat ./VERSION)
export DOCKERFILE=dockerfiles/Dockerfile.${UBUNTU}.${BUILD}
sudo rm -rf /opt/lapps-builds/latest/*
docker build -t lapps:${UBUNTU}-${BUILD} -f $DOCKERFILE --force-rm . || die "Dockerfile for specified build is missing"
docker run -it --rm --name myldev -h ldev -v /opt/lapps-builds/latest:/opt/lapps lapps:${UBUNTU}-${BUILD} ./inDockerPackage.${BUILD}.sh || die "Something went wrong: build has failed"
sudo mv /opt/lapps-builds/latest/packages/lapps-${VERSION}-${BUILD}-amd64.deb packages/${UBUNTU}/
else
echo "This script have to be started from within LAppS root build directory (clone of https://github.com/ITpC/LAppS.git)"
fi