-
Notifications
You must be signed in to change notification settings - Fork 2
/
trifinger.def
48 lines (38 loc) · 1.31 KB
/
trifinger.def
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
# Install the BLMC_EI project software in the image so it can be used without
# building
Bootstrap: localimage
From: {{ BASE_IMAGE }}
%arguments
BASE_IMAGE=trifinger_base.sif
REALTIME_BUILD=false
%files
{{ WS_DIR }} /opt/blmc_ei
%post -c /bin/bash
set -o errexit
set -o nounset
set -o pipefail
NOW=`date`
echo "export IMAGE_BUILD_DATE=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT
cd /opt/blmc_ei
# store git revision of each package (so we know which versions were used)
for d in src/*/
do
echo "${d#*/}"
git -C "$d" describe --always 2> /dev/null
git --no-pager -C "$d" show --pretty='[%cs] %d: %s' --no-patch 2> /dev/null
git -C "$d" status -s 2> /dev/null
echo ""
done > git_status.txt
# explicitly set OS version to preempt-rt if REALTIME_BUILD=true
if [ {{ REALTIME_BUILD }} = true ]; then
CMAKE_ARG_OS_VERSION=-DOS_VERSION=preempt-rt
else
CMAKE_ARG_OS_VERSION=
fi
bash -c ". /setup.bash; colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARG_OS_VERSION}"
echo ". /opt/blmc_ei/install/local_setup.bash" >> /setup.bash
# cleanup build and source files to reduce image size
rm -rf build src log
%runscript
# run something with environment set up
bash -c ". /setup.bash; $*"