build_data.sh 2.14 KB
Newer Older
incardon's avatar
incardon committed
1 2
#! /bin/bash

incardon's avatar
incardon committed
3
# Make a directory in /tmp/openfpm_data
incardon's avatar
incardon committed
4

incardon's avatar
incardon committed
5 6 7 8 9
echo "Build on: $2 with $3"

mkdir /tmp/openfpm_data_$3
mv * .[^.]* /tmp/openfpm_data_$3
mv /tmp/openfpm_data_$3 openfpm_data
incardon's avatar
incardon committed
10

incardon's avatar
incardon committed
11
mkdir openfpm_data/src/config
incardon's avatar
incardon committed
12

incardon's avatar
incardon committed
13
git clone git@ppmcore.mpi-cbg.de:incardon/openfpm_devices.git openfpm_devices
incardon's avatar
incardon committed
14

incardon's avatar
incardon committed
15
cd "$1/openfpm_data"
incardon's avatar
incardon committed
16

incardon's avatar
incardon committed
17
pre_command=""
incardon's avatar
incardon committed
18
sh ./autogen.sh
incardon's avatar
incardon committed
19
if [ "$2" == "master" ]; then
incardon's avatar
incardon committed
20
  options="$options --disable-gpu"
incardon's avatar
incardon committed
21
fi
incardon's avatar
incardon committed
22 23

if [ x"$3" == x"SE"  ]; then
24 25
  options="$options --enable-se-class1 --enable-se-class2 --enable-se-class3 --with-action-on-error=throw --enable-test-coverage"
  opt_comp="for security enhancement"
incardon's avatar
incardon committed
26 27 28
fi

if [ x"$3" == x"VALGRIND" ]; then
incardon's avatar
incardon committed
29
  pre_command="valgrind --leak-check=full"
incardon's avatar
incardon committed
30
  options="$options --disable-gpu --enable-test-coverage"
31
  opt_comp="for valgrind test"
incardon's avatar
incardon committed
32 33 34
fi

sh ./configure $options
incardon's avatar
incardon committed
35
if [ $? -ne 0 ]; then
36
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to comfigure openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
37 38
    exit 1
fi
incardon's avatar
incardon committed
39
make
incardon's avatar
incardon committed
40
if [ $? -ne 0 ]; then
41
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed to compile the openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
42
    exit 1
incardon's avatar
incardon committed
43
fi
incardon's avatar
incardon committed
44

incardon's avatar
incardon committed
45
$pre_command ./src/mem_map
incardon's avatar
incardon committed
46
if [ $? -ne 0 ]; then
47
    curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Error:\", \"color\": \"#FF0000\", \"text\":\"$2 failed the test with openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
incardon's avatar
incardon committed
48 49
    exit 1
fi
incardon's avatar
incardon committed
50

51
curl -X POST --data "payload={\"icon_emoji\": \":jenkins:\", \"username\": \"jenkins\"  , \"attachments\":[{ \"title\":\"Info:\", \"color\": \"#00FF00\", \"text\":\"$2 completed succeffuly the openfpm_data test $opt_comp \" }] }" https://hooks.slack.com/services/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
52