-
Notifications
You must be signed in to change notification settings - Fork 1
/
eurolinux_ci_build.sh
executable file
·57 lines (48 loc) · 1.42 KB
/
eurolinux_ci_build.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
#!/bin/sh
# Build steps used in EuroLinux CI
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "Changing directory to $DIR"
cd $DIR
setup_ip_tables(){
sudo iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A INPUT -p icmp -j ACCEPT
sudo iptables -A INPUT -i lo -j ACCEPT
sudo iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
sudo iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
sudo iptables -A FORWARD -j REJECT --reject-with icmp-host-prohibited
sudo iptables-save | sudo tee /etc/sysconfig/iptables
sudo service iptables restart
}
correct_vagrant(){
hash iptables 2> /dev/null && setup_ip_tables
echo "removing .git directory, it interfere with git tests"
rm -rf .git
}
# correct vagrant enviroment
correct_vagrant
while (( "$#" )); do
case "$1" in
-p|--prod)
PROD_FLAG=1
shift
;;
-*|--*=) # unsupported flags
echo "Error: Unsupported flag $1" >&2
exit 1
;;
*) # preserve positional arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
# set positional arguments in their proper place
eval set -- "$PARAMS"
# correct vagrant enviroment
if [[ -z $PROD_FLAG ]]; then
correct_vagrant
fi
sudo yum -y update
uname -a
export LANG=en_US.UTF-8
sudo SKIP_QA_HARNESS=1 ./runtests.sh $1