-
Notifications
You must be signed in to change notification settings - Fork 15
/
build-x86_64-static.sh
executable file
·48 lines (37 loc) · 1.35 KB
/
build-x86_64-static.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
#!/bin/sh
# https://twindb.com/building-rpm-on-travis-ci-in-docker-containers/
# https://lebkowski.name/docker-volumes/
#
# Clean up all existed images:
# sudo docker rm -v $(sudo docker ps -a -q -f status=exited)
set -e
. ./package.conf
IPRANGE_MD5=`cut -f1 -d' ' < build/iprange.md5`
mkdir -p build/x86_64-static
cd build/x86_64-static
cp -rp ../../x86_64-static/*.sh .
sudo rm -rf iprange
tar xfj ../iprange-$IPRANGE_VERSION.tar.bz2
mv iprange-$IPRANGE_VERSION iprange
cp -rp ../../x86_64-static/iprange/*.sh iprange
if ! sudo docker inspect firehol-package-x86_64-static > /dev/null 2>&1
then
# To run interactively:
# sudo docker run -it firehol-package-x86_64-static /bin/sh
# (add -v host-dir:guest-dir:rw arguments to mount volumes)
# To remove images in order to re-create:
# sudo docker rm -v $(sudo docker ps -a -q -f status=exited)
# sudo docker rmi firehol-package-x86_64-static
sudo docker run -v `pwd`:/fh-build/x86_64-static:rw alpine:3.5 \
/bin/sh /fh-build/x86_64-static/docker-setup.sh
id=`sudo docker ps -l -q`
sudo docker commit $id firehol-package-x86_64-static
fi
sudo docker run -v `pwd`:/fh-build/x86_64-static:rw firehol-package-x86_64-static \
/bin/sh /fh-build/x86_64-static/iprange/docker-build.sh
cd ../..
if [ "$USER" ]
then
sudo chown -R "$USER" .
fi
# TODO: cp -p ??? output/packages