forked from balena-io-library/base-images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate-stackbrew-library.sh
executable file
·57 lines (48 loc) · 1.22 KB
/
generate-stackbrew-library.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
#!/bin/bash
set -e
self="$(basename "$0")"
root="$(dirname "$(readlink -f "$BASH_SOURCE[0]")")"
images='debian alpine fedora ubuntu device'
usage() {
cat <<EOUSAGE
usage: $self [image|all]
ie: $self debian
$self all
This script generates stackbrew library for the specified Dockerfiles.
Supported image: debian, alpine, fedora, ubuntu. Passing 'all' will generate the library file for all Dockerfiles.
EOUSAGE
}
if [ $# -eq 0 ]; then
echo "No arguments provided"
usage
exit 1
fi
for arg in "$@"
do
case $arg in
'alpine')
bash "$root/scripts/stackbrew-library/generate-alpine-stackbrew-library.sh"
;;
'debian')
bash "$root/scripts/stackbrew-library/generate-debian-stackbrew-library.sh"
;;
'fedora')
bash "$root/scripts/stackbrew-library/generate-fedora-stackbrew-library.sh"
;;
'ubuntu')
bash "$root/scripts/stackbrew-library/generate-ubuntu-stackbrew-library.sh"
;;
'all')
for image in $images; do
bash "$root/scripts/stackbrew-library/generate-$image-stackbrew-library.sh"
done
;;
*)
{
echo "error: unknown argument: $arg"
usage
} >&2
exit 1
;;
esac
done