-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathmake-release-debian.sh
More file actions
executable file
·77 lines (67 loc) · 1.69 KB
/
make-release-debian.sh
File metadata and controls
executable file
·77 lines (67 loc) · 1.69 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
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#
# Usage example:
# ./make-release-linux.sh -v 3.2
#
set -e
function print_usage () {
echo Usage:
echo " `basename $0` -v <version> [-k]"
echo " -v OPL PC Tools version"
echo " -k skip docker artifact cleanup"
}
CLEAR_DOCKER=true
while getopts ":v:k" name; do
case $name in
v)
VERSION=${OPTARG}
echo Building OPL PC Tools v${VERSION}
;;
k)
CLEAR_DOCKER=false
echo Docker artifacts will not be cleaned up
;;
\?)
echo "Invalid option ${OPTARG}" >&2
print_usage
exit 1
;;
:)
echo "Value of the option ${OPTARG} is required" >&2
print_usage
exit 1
;;
esac
done
if [ -z ${VERSION} ]; then
echo "Version is not specified" >&2
print_usage
exit 1
fi
BASE_IMAGE="debian:stable"
QT_VERSION="6.9.1"
if command -v docker &> /dev/null; then
CRI_CTL=docker
echo Docker will be used to build image
elif command -v podman &> /dev/null; then
CRI_CTL=podman
echo Podman will be used to build image
else
echo Docker of Podman is required
exit 1
fi
${CRI_CTL} build \
--tag oplpctools \
--build-arg VERSION=${VERSION} \
--build-arg BASE_IMAGE=${BASE_IMAGE} \
--build-arg QT_VERSION=${QT_VERSION} \
-f Dockerfile.debian \
.
${CRI_CTL} create --name oplpctools -t oplpctools:latest
${CRI_CTL} cp oplpctools:/oplpctools/oplpctools_linux_${VERSION}_amd64.tar.gz ./release/
${CRI_CTL} rm oplpctools
if ${CLEAR_DOCKER}; then
echo Cleaning up docker artifacts...
${CRI_CTL} image rm -f oplpctools:latest ${BASE_IMAGE}
${CRI_CTL} system prune
fi