2023-04-13 08:36:12 -07:00
|
|
|
SDIR=$(dirname "$(realpath "$BASH_SOURCE")")
|
2023-03-31 13:43:26 -07:00
|
|
|
build=${UDBUILD:-$(command -v udbuild)}
|
|
|
|
if [[ $build ]];then
|
2023-04-13 08:36:12 -07:00
|
|
|
# by sourcing the build script and then calling the build function udbuild
|
|
|
|
# the build script environment will be availabe in this script
|
|
|
|
source $build
|
|
|
|
udbuild load_env_file $@
|
|
|
|
udbuild build_src
|
|
|
|
echo caddy build source at $BUILD_SRC
|
|
|
|
if [[ $BUILD_CADDY_CONF ]]; then
|
|
|
|
CONF_DIR=${CONF_DIR:-${PWD}/conf}
|
|
|
|
if [[ -d $CONF_DIR ]]; then
|
2023-04-22 10:23:44 -07:00
|
|
|
mkdir -p ${BUILD_SRC}/init/opt/caddy/conf
|
2023-04-13 08:36:12 -07:00
|
|
|
echo adding caddy conf/ directory $CONF_DIR to build
|
|
|
|
ls -la $CONF_DIR
|
2023-04-22 10:23:44 -07:00
|
|
|
/bin/cp -R $CONF_DIR/. ${BUILD_SRC}/init/opt/caddy/conf
|
2023-04-13 08:36:12 -07:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
BUILD_PKGS=${BUILD_PKGS:-${PWD}/caddy.pkgs}
|
|
|
|
if [[ -f $BUILD_PKGS ]]; then
|
|
|
|
echo adding caddy packages at $BUILD_PKGS to build
|
|
|
|
/bin/cp $BUILD_PKGS ${BUILD_SRC}/init/caddy.pkgs
|
|
|
|
fi
|
|
|
|
udbuild "$@"
|
|
|
|
rm -rf ${BUILD_SRC}/init/caddy/conf/
|
|
|
|
rm -f ${BUILD_SRC}/init/caddy.pkgs
|
|
|
|
else
|
|
|
|
echo can not find UCI Docker Build script, run ./install from the uci-docker-build repo
|
2023-03-31 13:43:26 -07:00
|
|
|
fi
|