-
Notifications
You must be signed in to change notification settings - Fork 44
/
build-all.sh
64 lines (54 loc) · 1.26 KB
/
build-all.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
60
61
62
63
64
#!/bin/bash
set -eo pipefail
root=$PWD
mkdir -p logs
# Requires:
# apt-get install -y curl ruby-dev build-essential git pkg-config python-pip
# gem install bundler
# pip install virtualenv-tools
skiplist="couchdb freemind jruby kafka kestrel xdotool"
build_package() {
local recipe="$1"
local deps=$(bundle exec fpm-cook show-deps $recipe)
if [ -n "$deps" ]; then
apt-get -y install $deps
fi
bundle exec fpm-cook clean "$recipe"
bundle exec fpm-cook package "$recipe"
}
bundle exec fpm-cook --version
#for recipe in $(find * -name recipe.rb | sort); do
for recipe in $(find * -maxdepth 2 -name "*.rb" | sort); do
cd $root
recipe_name=$(dirname $recipe)
echo "### [$recipe_name] ###"
for skip in $skiplist; do
if [ "$skip" = "$recipe_name" ]; then
echo "SKIP"
continue 2
fi
for file in *.rb; do
if [ "$skip" = "${recipe_name}/${file}" ]; then
echo "SKIP"
continue 2
fi
done
done
cd "$recipe_name"
if [ -d "tmp-build" -a -e "tmp-build/.all-done" ]; then
echo "DONE"
continue
fi
{
if [ -e "recipe.rb" ]; then
build_package "recipe.rb"
else
for file in *.rb; do
echo "===> $file"
build_package "$file"
done
fi
mkdir -p tmp-build
touch tmp-build/.all-done
} 2>&1 | tee "$root/logs/${recipe_name}.log"
done