29 lines
1.1 KiB
Plaintext
Executable File
29 lines
1.1 KiB
Plaintext
Executable File
SDIR=$(dirname "$(realpath "$BASH_SOURCE")")
|
|
build=${UDBUILD:-$(command -v udbuild)}
|
|
if [[ $build ]];then
|
|
# 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
|
|
mkdir -p ${BUILD_SRC}/init/opt/caddy/conf
|
|
echo adding caddy conf/ directory $CONF_DIR to build
|
|
ls -la $CONF_DIR
|
|
/bin/cp -R $CONF_DIR/. ${BUILD_SRC}/init/opt/caddy/conf
|
|
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
|
|
fi |