forked from shaunsephton/shaunsephton.recipe.uwsgi
-
Notifications
You must be signed in to change notification settings - Fork 10
/
travis_test.sh
executable file
·59 lines (44 loc) · 1.1 KB
/
travis_test.sh
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
#!/bin/bash
recipe_path=$(dirname $0)
create_buildout_cfg() {
cat << _EOF > buildout.cfg
[buildout]
develop = ${recipe_path}
parts = uwsgi
[uwsgi]
recipe = buildout.recipe.uwsgi
_EOF
}
test_that_building_works() {
create_buildout_cfg
echo "[+] buildout.cfg: "
cat buildout.cfg
# test that the buildout works
echo "[+] running buildout"
buildout -vN
if [[ ! -x "bin/uwsgi" ]]
then
echo "[!] failed to build binary"
exit 1
else
echo "[+] successful"
fi
}
test_build_in_barebones_environment() {
create_buildout_cfg
# clear environment except PATH, see what happens
echo "[+] running buildout in barebones env"
env -i PATH=${PATH} buildout -vN
if [[ ! -x "bin/uwsgi" ]]
then
echo "[!] failed to build binary"
exit 1
else
echo "[+] successful"
fi
}
echo "----------------------------------------"
echo "starting test on branch ${TRAVIS_BRANCH} (pull request: ${TRAVIS_PULL_REQUEST})"
echo "----------------------------------------"
test_that_building_works
test_build_in_barebones_environment