-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
executable file
·72 lines (61 loc) · 1.52 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
set -e
if [ "$#" -lt 1 ] ; then
cat >&2 <<EOF
usage: $0 [package]
available package names:
* python2-tds
* tds-installer
* tds-update-yum-repo
EOF
exit 1
fi
PACKAGE=$1
ITERATION=${PARENT_BUILD_NUMBER:-1}
declare -a COMMON_CMD=(\
docker_build/run.sh \
--iteration "$ITERATION" \
)
declare -a DAEMON_CMD=(\
"${COMMON_CMD[@]}" \
-s dir \
--depends-same-version python2-tds \
--version-py \
-- \
-a noarch \
--template-scripts \
--after-install pkg/rpm/after_install.sh.erb \
--before-remove pkg/rpm/before_remove.sh.erb \
--after-remove pkg/rpm/after_remove.sh.erb \
--no-rpm-auto-add-directories \
--prefix /lib/systemd/system \
)
declare -a CMD
case "$PACKAGE" in
python2-tds )
CMD=("${COMMON_CMD[@]}")
;;
tds-installer )
CMD=( \
"${DAEMON_CMD[@]}" \
-C systemd/tds_installer \
--template-value unit=tds_installer.service \
--name tds-installer \
--description 'Daemon to manage installations for deployment application' \
)
;;
tds-update-yum-repo )
CMD=( \
"${DAEMON_CMD[@]}" \
-C systemd/update_deploy_repo \
--template-value unit=update_deploy_repo.service \
--name tds-update-yum-repo \
--description 'Daemon to update repository for deployment application' \
)
;;
* )
echo "error: unrecognized package name: $PACKAGE" >&2
exit 1
;;
esac
exec "${CMD[@]}"