-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·63 lines (55 loc) · 1.81 KB
/
install.sh
File metadata and controls
executable file
·63 lines (55 loc) · 1.81 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
#!/bin/bash
# This file is part of servoarray.
#
# servoarray is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# servoarray is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with servoarray. If not, see <http://www.gnu.org/licenses/>.
set -euo pipefail
function base_image_python() {
if [ -n "${CROSS:-}" ]; then
echo "balenalib/${CROSS}-python:${PYTHON_VERSION}-${DEBIAN_VERSION}-build"
else
echo "python:${PYTHON_VERSION}-slim-${DEBIAN_VERSION}"
fi
}
function base_image_deb() {
if [ -n "${CROSS:-}" ]; then
echo "balenalib/${CROSS}:${DEBIAN_VERSION}-build"
else
echo "debian:${DEBIAN_VERSION}-slim"
fi
}
function base_image() {
case ${BUILD_TYPE} in
"python" ) base_image_python ;;
"deb" ) base_image_deb ;;
* ) echo "unknown build type ${BUILD_TYPE}"; exit -1 ;;
esac
}
function cross_sh() {
if [ -n "${CROSS:-}" ]; then
echo "[\"/usr/bin/qemu-arm-static\", \"-execve\", \"/bin/sh\", \"-c\"]"
else
echo "[\"/bin/sh\", \"-c\"]"
fi
}
readonly BASE_IMAGE=$(base_image)
readonly CROSS_SH=$(cross_sh)
readonly BOOST_VERSION=1.69.0
echo "BASE_IMAGE=${BASE_IMAGE}"
cat ci/image/Dockerfile.in \
| sed "s/@BASE_IMAGE@/${BASE_IMAGE//\//\\/}/g" \
| sed "s/@SHELL@/${CROSS_SH//\//\\/}/g" \
| sed "s/@BOOST_VERSION@/${BOOST_VERSION}/g" \
| sed "s/@BOOST_VERSION_U@/${BOOST_VERSION//\./_}/g" \
> ci/image/Dockerfile
docker build ci/image -t builder