File: travis_script_linux_docker

package info (click to toggle)
gpsbabel 1.10.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 95,680 kB
  • sloc: cpp: 104,866; xml: 9,686; sh: 1,792; ansic: 1,086; perl: 520; tcl: 74; makefile: 18
file content (25 lines) | stat: -rwxr-xr-x 872 bytes parent folder | download | duplicates (4)
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
#!/bin/bash -ex
#
# setup up and run a docker build.
# this is used by travis.
#
# run the build and regression in a newly created container.
# pass the compiler from the travis matrix through CC, CXX.
# we need the default charmap to be UTF-8 for test_encoding_utf8, explicit set it here through LC_ALL.
# travis has got the code to test in the pwd.

ver=${1}
versuffix=${ver:+_$1}
script=${2:-./build_and_test}
docker run \
--rm \
--mount type=bind,source="$(pwd)",target=/app \
--env CC=$CC \
--env CXX=$CXX \
--env LC_ALL=C.UTF-8 \
--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly \
--mount type=bind,source=/etc/group,target=/etc/group,readonly \
--user "$(id -u):$(id -g)" \
--cap-add SYS_PTRACE \
tsteven4/gpsbabel_build_environment${versuffix} \
bash -c "if [ -n ${ver} ]; then if [ -e /opt/${ver}.env ]; then . /opt/${ver}.env; fi; fi; ${script}"