-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathbuilder.sh
executable file
·66 lines (56 loc) · 1.56 KB
/
builder.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
65
66
#!/usr/bin/env bash
# stop on errors.
set -e
# define starting directory.
PA_SOURCES_PATH=$(pwd)
# load variables from scripts config.
# shellcheck disable=SC1090
source "${PA_SOURCES_PATH}/config.sh"
# source helpers.
# shellcheck disable=SC1090
source "${BASH_SOURCE%/*}/helpers/colors.sh"
# shellcheck disable=SC1090
source "${BASH_SOURCE%/*}/helpers/prepare.sh"
# shellcheck disable=SC1090
source "${BASH_SOURCE%/*}/helpers/flags.sh"
# shellcheck disable=SC1090
source "${BASH_SOURCE%/*}/helpers/build.sh"
# ensure starts on sources path.
# shellcheck disable=SC2164
cd "${PA_SOURCES_PATH}"
# update repositories first.
sudo apk update
# run for extra packages.
if [ "$PA_BUILD_EXTRA" = true ]; then
# verbose.
information "running tasks for:" "extra packages."
# loop and build packages.
build_list "${PA_PHP_EXTRA}";
else
warning "skipping:" "extra packages."
fi
# # run for main php package.
if [ "$PA_BUILD_MAIN" = true ]; then
# verbose.
information "running tasks for:" "main (php)."
# update apk so extra packages are available.
sudo apk update
# build package.
build_package "${PA_PHP_MAIN}"
else
warning "skipping:" "main (php)."
fi
# run for extensions.
if [ "$PA_BUILD_EXTENSIONS" = true ]; then
# verbose.
information "running tasks for:" "extensions."
# update apk so main & extra packages are available.
sudo apk update
# loop and build packages.
build_list "${PA_PHP_EXTENSIONS_PREFIXED}";
else
warning "skipping:" "extensions."
fi
# ensure the final destination is the sources path.
# shellcheck disable=SC2164
cd "$PA_SOURCES_PATH"