-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpre_build_hook
executable file
·31 lines (27 loc) · 1013 Bytes
/
pre_build_hook
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
#!/bin/bash
# Add here any the actions which are required before plugin build
# like packages building, packages downloading from mirrors and so on.
# The script should return 0 if there were no errors.
set -x
PLUGIN_DIR=$(cd `dirname $0` && pwd -P)
# do some preflight checks on some of the required utilities to build this
# plugin.
CMDS="librarian-puppet dh_make"
for CMD in $CMDS; do
command -v $CMD >/dev/null && continue || { echo "${CMD} not installed"; exit 1; }
done
# don't package the .git folders for the plugins we download
pushd ${PLUGIN_DIR}/deployment_scripts/puppet
librarian-puppet install --path=./modules
for DIR in `find ${PLUGIN_DIR}/deployment_scripts/puppet -iname '.git'`; do
rm -rf "${DIR}"
done
popd
#
# You can use a skip-debs file in the .utils directory to skip building the
# deb packages at plugin build time
#
if [ ! -f "${PLUGIN_DIR}/.utils/skip-debs" ]; then
${PLUGIN_DIR}/.utils/build_all_debs.sh
mv ${PLUGIN_DIR}/.utils/*.deb ${PLUGIN_DIR}/repositories/ubuntu/
fi